Reputation: 109
Used storyboard to create navigation bar. and now in ios 7 i have a challenge to increase the height of navigation bar.
UINavigationBar *navBar = [[self navigationController] navigationBar];
[navBar setFrame:CGRectMake(0, 100, 1024, 200)];
Upvotes: 1
Views: 462
Reputation: 192
Use this -
@implementation UINavigationBar (customNavBar)
- (CGSize)sizeThatFits:(CGSize)size
{
CGSize navSize = CGSizeMake(self.frame.size.width,200);
return navSize;
}
Upvotes: 0
Reputation:
You can't change the height of the navigation bar. It's fixed at 44 pixels.
Upvotes: 0
Reputation: 6524
UIFont *font = [UIFont fontWithName:@"fontName" size:YourFloatSize];
CGSize titleSize = [title sizeWithFont:font];
UILabel *titleLable = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, titleSize.width, titleSize.height)];
titleLable.text = title;
titleLable.textAlignment = NSTextAlignmentCenter;
titleLable.backgroundColor = [UIColor clearColor];
titleLable.textColor = [UIColor anyColorYouWant];
titleLable.font = font;
self.navigationItem.titleView = titleLable;
Upvotes: 2