I saw a solution to change the height of navigation bar. But nothing worked for me. Now my application has one view controller connected with a navigation controller. I have not yet implemented any other code in my project. Before starting my project I need to change my height of my navigation bar.
edited:
.h:
- (CGSize)sizeThatFits:(CGSize)size ;
.m:
@implementation UINavigationBar (customNav)
- (CGSize)sizeThatFits:(CGSize)size {
CGSize newSize = CGSizeMake(370,40);
return newSize;
}
@end
UIView *NavView = [[UIView alloc] initWithFrame:CGRectMake(0, 0 , [UIScreen mainScreen].bounds.size.width , 44)];
NavView.backgroundColor = [UIColor clearColor];
NavView.userInteractionEnabled = YES;
[self.navigationController.navigationBar addSubview:NavView];
UIButton *DateBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 10, 90, 30)];
DateBtn.backgroundColor = [UIColor clearColor];
[DateBtn setTitle:@"Jan 05" forState:UIControlStateNormal];
DateBtn.titleLabel.font = [UIFont fontWithName:BrushScriptStd size:18];
[DateBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[NavView addSubview:DateBtn];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With