How to add tabbar below navigation bar using the Material's pod by CosmicMind
I was able to achieve this but it was touching the status bar like this
I want this to be below the status bar.
How to add tabbar below navigation bar using the Material's pod by CosmicMind
I was able to achieve this but it was touching the status bar like this
I want this to be below the status bar.
You can do with below code, add 20px StatusBar
Height in 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)
}
You can create custom class of Tabbar and change frame at top:
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)
}