2017-06-21 3 views

答えて

1

あなたはタブバーのカスタムクラスを作成して、上部のフレームを変更することができます。

class CustomTabBarController: UITabBarController { 

    @IBOutlet weak var myTabBarOutlet: UITabBar! 

    override func viewDidLoad() { 
     super.viewDidLoad() 

     UIApplication.shared.statusBarFrame.size.height 
     myTabBarOutlet.frame = CGRect(x: 0, y: myTabBarOutlet.frame.size.height, width: myTabBarOutlet.frame.size.width, height: myTabBarOutlet.frame.size.height) 
    } 
2

あなたはコードの下で行うことができ、Top(20)

fileprivate func prepareTabBar() { 
    tabBar = TabBar() 
    tabBar.delegate = self 

    tabBar.dividerColor = Color.grey.lighten4 
    tabBar.dividerAlignment = .bottom 

    tabBar.lineColor = Color.indigo.base 
    tabBar.lineAlignment = .bottom 

    tabBar.backgroundColor = Color.grey.lighten3 
    tabBar.buttons = buttons 

    view.layout(tabBar).horizontally().top(20) 
} 

enter image description here

に20ピクセル StatusBar身長を追加
関連する問題