I have an application that uses Storiesboards to display two screens. The first is a list (see Screenshot as "Lista"), and the second is a map ("Térkép"). Each view has a left and right navigation button. Pressing the right button displays the map in the navigation controller. The back button is hidden manually using the map method viewDidLoad .


The question is, why do bar panel items have a different size on each screen? How can I control the size of the buttons?
The images on the buttons are the same size. Skinning is performed in AppDelegate through appearance settings:
// navbar background [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"bg-titlebar.png"] forBarMetrics:UIBarMetricsDefault]; // navbar button background [[UIBarButtonItem appearance] setBackgroundImage:[[UIImage imageNamed:@"btn-main.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(4.0, 4.0, 4.0, 4.0) resizingMode:UIImageResizingModeStretch] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; [[UIBarButtonItem appearance] setBackgroundImage:[[UIImage imageNamed:@"btn-main-active.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(4.0, 4.0, 4.0, 4.0) resizingMode:UIImageResizingModeStretch] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault]; // back button background [[UIBarButtonItem appearance] setBackButtonBackgroundImage:[[UIImage imageNamed:@"btn-back.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(4.0, 12.0, 4.0, 4.0) resizingMode:UIImageResizingModeStretch] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; [[UIBarButtonItem appearance] setBackButtonBackgroundImage:[[UIImage imageNamed:@"btn-back-active.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(4.0, 12.0, 4.0, 4.0) resizingMode:UIImageResizingModeStretch] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
ios iphone uinavigationbar uibarbuttonitem
gklka
source share