Reputation:
I have to following code to adjust the height of my UINavigationBar
:
[self.navigationController.navigationBar setFrame:CGRectMake(0, 0, self.view.frame.size.width, 90)];
This works only for a split second when pushing the view before the bar resizes to its default height. I think this is because Auto Layout is enabled, but I'm not sure. How would I keep my UINavigationBar
at my desired height without it returning to its default state?
Upvotes: 0
Views: 1266
Reputation: 611
Apple provides some great sample code demonstrating common ways to manage the navigation bar in the Customizing UINavigationBar project. That's probably the best place to find the specific setup for what you're trying to do.
To answer the specific question, you would need to create a custom subclass of UINavigationBar and override the height in layoutSubviews
since ultimately, Apple's code will continually attempt to reset the size during transitions.
Upvotes: 1