问题
I cant change navigation bar frame in ios 11. Here is sample of my code for ios 10:
if let navigationBar = self.navigationController?.navigationBar {
let frame = CGRect(x: navigationBar.frame.origin.x,
y: navigationBar.frame.origin.y,
width: navigationBar.frame.width,
height: navigationBar.frame.height + 100)
navigationBar.frame = frame
}
ios 10 and ios 11 screenshots respectively
回答1:
Changing the height of the UINavigationBar is no longer directly supported in iOS 11 (see here, here & here).
The best you can hope for is to do something like having a view behind the navigation bar and removing the borders (see here for customisation examples).
来源:https://stackoverflow.com/questions/48102678/cant-change-navigation-bar-height-ios-11