Chr*_*ris 2 xcode image tabbar ios5
我试图让我的自定义视网膜图像显示在我的自定义iOS5 TabBar中失败.
我的TabBar中有4个项目,我已将选中/未选中的图像设置为contact@2x.png,其分辨率为160px x 75px.我认为这些160px宽度图像中的4个可以很好地适应640px视网膜宽度.
您可以在这里查看我的contact@2x.png https://lh4.googleusercontent.com/-afHulbEcxNE/TuPe-YIj91I/AAAAAAAAAII/lCojphAxF9w/s160/contact%2525402x.png
我已经按照下面的程序设置了所有项目.
UIImage *selectedContact = [UIImage imageNamed:@"contact@2x.png"];
UIImage *unselectedContact = [UIImage imageNamed:@"contact@2x.png"];
UITabBar *tabBar = self.tabBarController.tabBar;
UITabBarItem *item0 = [tabBar.items objectAtIndex:0];
UITabBarItem *item1 = [tabBar.items objectAtIndex:1];
UITabBarItem *item2 = [tabBar.items objectAtIndex:2];
UITabBarItem *item3 = [tabBar.items objectAtIndex:3];
[item0 setFinishedSelectedImage:selectedContact withFinishedUnselectedImage:unselectedContact];
[item1 setFinishedSelectedImage:selectedContact withFinishedUnselectedImage:unselectedContact];
[item2 setFinishedSelectedImage:selectedContact withFinishedUnselectedImage:unselectedContact];
[item3 setFinishedSelectedImage:selectedContact withFinishedUnselectedImage:unselectedContact];
Run Code Online (Sandbox Code Playgroud)
在运行时,我可以看到比例设置为1
为什么不从图像后缀中拾取2?标签栏很大,并没有缩放.
请看下面的模拟器截图...
我的应用程序图标和默认图标的其他视网膜图像正常工作.
思考?我开车自己疯了☺提前谢谢.
JoePasq错了,他显然不是最新的iOS5外观定制API.您的问题可能是您在文件名中指定了@ 2x,只需将"contact.png"传递给imagedNamed即可...
[UIImage imageNamed:@"contact.png"]
| 归档时间: |
|
| 查看次数: |
4220 次 |
| 最近记录: |