iOS 7中的自定义后退指示器图像不是垂直居中的 [英] Custom back indicator image in iOS 7 not vertically centered
问题描述
我使用以下代码在我的iOS 7应用程序中为后退指示器使用自定义图像:
I am using the following code to use a custom image for the back indicator in my iOS 7 app:
UIImage *temp = [[UIImage imageNamed:@"back-black-on-black-normal-2"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[[UINavigationBar appearance] setBackIndicatorImage:temp];
[[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:temp];
奇怪的是,如果我使用22px高的图像(对于我们来说太小了)希望,顺便说一下),它在导航栏中垂直居中。然而,一旦我开始使它变得更合理,它就会垂直偏离(这里它的高度为44px,对我们来说仍然太小但根本没有居中,如你所见):
The strange thing is, if I use an image that is 22px high (way too small for what we want, by the way), it centers vertically within in the nav bar just fine. Once I start to make it a more reasonable size, however, it gets way off vertically (here it's 44px high, still too small for us but not centering at all, as you can see):
非常感谢任何帮助或建议。谢谢。
Any help or suggestions greatly appreciated. Thanks.
推荐答案
检查按钮图像,是否有不需要的底部空间?
Check button image, is there any unwanted bottom space?
这篇关于iOS 7中的自定义后退指示器图像不是垂直居中的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!