iPhone - 没有加载~ipad图像 [英] iphone - not loading ~ipad image

查看:96
本文介绍了iPhone - 没有加载~ipad图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序包上的同一个地方有3张图片:image~iphone.png,image @ 2x~iphone.png和image~ipad.png。

I have 3 images on the same place on my app's bundle: "image~iphone.png", "image@2x~iphone.png" and "image~ipad.png".

当我这样做时

UIImage *imageU = [UIImage imageNamed:[[NSBundle mainBundle]  pathForResource:@"image"
ofType:@"png"]];

BOth,iPhone和iPhone 4雇用版本加载正常,但不是ipad图像。当我在iPad上运行时,我在imageU上没有。

BOth, the iPhone and iPhone 4 hires versions load fine, but not the ipad image. When I run on iPad, I get nil on imageU.

是的,图像在那里,名称是正确的(iphone~ipad.png)。

Yes, the image is there, the name is correct (iphone~ipad.png).

为什么?任何线索?

谢谢。

推荐答案

我发现解决方案因为:不要在iPad图像上使用任何扩展名。这种代字号技巧不适用于iPad。还有一个让我们浪费时间的东西。

I discovered that the solution for that is: do not use any extension on the iPad images. This tilde trick is not working for iPad. One more buggy stuff that makes us waste time.

这篇关于iPhone - 没有加载~ipad图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆