My root view controller is a UITabBarController with 2 tabs and an MDCAppBar. The design looks just fine on the story board with the 2 tabs placed in equal halves. However when I run the application the 2 tabs appear compressed. I have tried many things but am unable to resolve this. Any help / advice is appreciated. Please see code and screenshots below:
Code of root view controller:
class BeenstaqTabBarViewController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
let delegate = UIApplication.shared.delegate as! AppDelegate
let appBar = delegate.appBar
addChildViewController(appBar.headerViewController)
appBar.headerViewController.headerView.backgroundColor = MDCPalette.lightBlue.tint800
appBar.navigationBar.tintColor = UIColor.white
appBar.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white,
NSFontAttributeName: UIFont(name: "Roboto-Light", size: 24)!]
appBar.addSubviewsToParent()
title = "beenstaq"
let rightNavIcon = UIImage (named: "Settings")
navigationItem.rightBarButtonItem = UIBarButtonItem(image: rightNavIcon,
style: .plain,
target: self,
action: #selector(barButtonDidTap(_:)))
let leftNavIcon = UIImage (named: "ic_add_circle_outline_white")
navigationItem.leftBarButtonItem = UIBarButtonItem(image: leftNavIcon,
style: .plain,
target: self,
action: #selector(barButtonDidTap(_:)))
}
func barButtonDidTap(_ sender: UIBarButtonItem) {
}
}