2017-06-21 48 views
1

如何添加以下使用材料的吊舱由CosmicMind导航栏的TabBar添加下面状态栏标签栏使用材料的iOS

我能做到这一点,但它触及这样

enter image description here

状态栏

我希望这是低于状态栏。

回答

1

您可以在上面创建自定义类的TabBar和变化框架:

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

添加20px的 StatusBar高度