#import "ViewController.h"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setupTopBar];
}
- (BOOL)prefersStatusBarHidden {
return YES;
}
- (void)setupTopBar {
UINavigationBar *navigationBar = self.navigationController.navigationBar;
navigationBar.tintColor = [UIColor whiteColor];
[navigationBar setBackgroundImage:[UIImage imageNamed:@"topbar_bg_black_1px"] forBarMetrics:UIBarMetricsDefault];
self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"topbar_logo"]];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"topbar_icon_menu"]
style:UIBarButtonItemStylePlain
target:nil
action:nil];
}
@end
Print out here: http://goo.gl/y0buK1 Topbar portrait height is bigger than topbar landscape height everywhere except iPhone 6 Plus. How make topbar landscape height to be equal topbar potrait height?