[英]UITabbar background image IPhone 6 issue
I'm developing Tab bar Application and found strange issue on iPhone 6 我正在开发Tab栏应用程序,并在iPhone 6上发现了奇怪的问题
Notice that image is not wide enough for full screen but repeated. 请注意,图像的宽度不足以全屏显示,但会重复显示。 I have set image through both storyboard and programmatically I have also have 2x and 3x images placed in Images.xcassets 我已经通过情节提要和编程方式设置了图像,并且在Images.xcassets中也放置了2x和3x图像。
For any one who comes here later, here is what i do 对于以后再来的任何人,这就是我要做的
After Some tries i've used a hack as follow 经过一番尝试之后,我使用了如下技巧
Following is code 以下是代码
#define isIPhone6 [[UIScreen mainScreen] bounds].size.height > 568 ? YES : NO
UITabBar *tabBar = tabBarController.tabBar;
UIImage* tabBarBackground = [UIImage imageNamed:@"tab_bar1.png"];
if (isIPhone6) {
tabBarBackground = [UIImage imageNamed:@"tab_bar2@3x.png"];
}
[tabBar setBackgroundImage:tabBarBackground];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.