Reputation: 51
I just want to use navigation bar in UIViewController
.
in iOS7, if we use navigation controller, the navigation bar height is 64px.
but when I use navigation bar in UIViewController
, I can't change navigation bar height.
the height is fixed 44px.
How can I change navigation bar's height using Interface builder, not programming?
Apple doesn't support this feature in xcode storyboard?
Upvotes: 1
Views: 9373
Reputation: 147
If you add a fixed height constraint to the UINavigationBar using autolayout, changing the height constraint constant will update the nav bar's height. You adjust this in the storyboard using the size inspector.
Before adding fixed height constraint:
After adding fixed height constraint:
Upvotes: 6
Reputation: 144
You can try this Code:
@interface UINavigationBar (myNave)
- (CGSize)changeHeight:(CGSize)size;
@end
@implementation UINavigationBar (customNav)
- (CGSize)sizeThatFits:(CGSize)size {
CGSize newSize = CGSizeMake(320,70);
return newSize;
}
@end
For more info visit : http://tutorialmode.com/ios/customising-an-ios-navigation-bar/
Upvotes: 1