答案 0 :(得分:2)
您可以使用以下代码,在StatusBar
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)
}
答案 1 :(得分: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)
}