问题
I'm trying to customize my navigationbar's UIBarbuttonItem so that I'm using this im my Appdelegate.m
// didFinishLaunchingWithOptions:
{
UIImage *navBarImage = [UIImage imageNamed:@"nav-bar.png"];
[[UINavigationBar appearance] setBackgroundImage:navBarImage
forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTitleVerticalPositionAdjustment:5
forBarMetrics:UIBarMetricsDefault];
UIImage *barButtonSave = [[UIImage imageNamed:@"nav-bar-button.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 2, 0, 2)];
[[UIBarButtonItem appearance] setBackgroundImage:barButtonSave
forState:UIControlStateNormal
style:UIBarButtonItemStyleDone
barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackgroundVerticalPositionAdjustment:5 forBarMetrics:UIBarMetricsDefault];
return YES;
}
When I'm done with this I just place a UIBarbuttonItem with Storyboard and I'm done. The point is I noticed that the "Save" button changes between my views!
It looks like is moving down few pixels in my DetailView:

Why is That?
回答1:
I still don't know why. but I solved giving my custom UIbarbuttonItem image the 30px default height.
[see similar issue UIBarButtonItem shifting downwards after a UINavigationController push
来源:https://stackoverflow.com/questions/15545051/ios-custom-uibarbuttonitem-change-position-in-detail-view