How do I change UINavigationBar height programmatically?
问题 How to change UINavigationBar height with code int iOS8 swift? I've tried using: UINavigationBar.resizableSnapshotViewFromRect UINavigationBar.drawViewHierarchyInRect UINavigationBar.frameForAlignmentRect None of these seem to accomplish this. 回答1: Here is example for you: import UIKit class BaseViewConroller: UIViewController { var navBar:UINavigationBar=UINavigationBar() override func viewDidLoad() { super.viewDidLoad() setNavBarToTheView() // Do any additional setup after loading the view.