我使用此代码进行自定义UIBarButtonItems:
backImage = [UIImage imageNamed:@"barButtonImage"];
backImage = [backImage resizableImageWithCapInsets:UIEdgeInsetsMake(0.0f, 6.0f, 0.0f, 6.0f) resizingMode:UIImageResizingModeTile];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackgroundImage:backImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
所有导航栏看起来都很好
但是工具栏以奇怪的方式调整了项目的大小:
所有UIBarButtonItem都在storyboard中定义,没有任何自定义视图。如何删除此大小调整?