iphone 4 - 加载图像x旧设备 [英] iphone 4 - loading images x old devices

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

问题描述

Apple表示你必须拥有@ 2x版本的图片并使用类似的东西

Apple says you must have @2x versions of your images and use a stuff like

UIImage* anImage = [UIImage imageNamed:@"Button"]; // without the extension

这将选择Button图像的低版本和雇用版本,具体取决于iPhone版本(3G / 3GS或4)。但是如果该应用程序也适用于iPad呢?

That will select the lowres and hires versions of Button image, depending on the iPhone version (3G/3GS or 4). But what if the app is for iPad too?

即使我没有指定扩展名,iPad也会加载Button图像吗?

Will the iPad load the Button image even if I don't specify the extension?

谢谢。

推荐答案

UIImage* anImage = [UIImage imageNamed:@"Button"]; // without the extension

UIImage* anImage = [UIImage imageNamed:@"Button.png"]; // with the extension

可以在iOS4上运行,因为苹果基本上不鼓励你使用任何其他图像而不是PNG你可以省略用力。

will work on iOS4, since apple basically discourage you from using any other image than PNG you can omit the exertion.

两者都适用于@ 2x.png文件。确保已将@ 2x文件添加到项目中。

Both work for @2x.png files as well. Make sure the @2x files have been added to your project.

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

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