whiteRussian
whiteRussian

Reputation: 13

why topbar height is different in portrait and landscape?

#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?

github: https://github.com/test1215/proto1

Upvotes: 0

Views: 184

Answers (1)

Anton Tropashko
Anton Tropashko

Reputation: 5816

I think your art designer is a moron who never read Apple HIG and/or thinks he knows better. Which he obviously does not (Something heavy just got off my chest). That being said and professional qualities and merits of your art guy aside (which merits a separate discussion with s.o. not being the best venue for flamewars and trolling) I'll probably end up having a custom navigation bar myself. Solely because stock UINavigationItem can't pull arbitrarily sized png over UIBarButtonItem.image (it has to be 22x22 44x44 and 66x66 per HIG).

Not sure if it helps. But I just HAD to comment on the professional qualities of the fine folks in the IT industry you are likely to run into outside the confines of US of A. I guess most of americans here are either too polite and/or bound by the decease of political correctness. Coming from the cultural background that does not tether me to the domain of PC I can safely comment on the root cause of your troubles with the navbar: the human factor.

Upvotes: 1

Related Questions