jMelvins
jMelvins

Reputation: 194

Cant change navigation bar height ios 11

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

ios 10 nav bar ios 11 nav bar

Upvotes: 2

Views: 10154

Answers (1)

Upholder Of Truth
Upholder Of Truth

Reputation: 4711

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).

Upvotes: 19

Related Questions