UIImage imageNamed 不适用于 ios 5.0 [英] UIImage imageNamed not work on ios 5.0

查看:30
本文介绍了UIImage imageNamed 不适用于 ios 5.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此代码:

[image setImage:[UIImage imageNamed:@"some@2x.png"]];

[image setImage:[UIImage imageNamed:@"some@2x.png"]];

它适用于 ios 4.3,但在 ios 5.0 上我看不到我的图像.

and it work on ios 4.3, but on ios 5.0 I don't see my image.

有人知道这是哪种问题吗?

Anybody know which kind this problem?

推荐答案

您通常不需要在名称中包含 @2x - iOS 应该自动选择正确的文件名(some.png 或 some@2x.png)取决于屏幕的比例.你有没有试过这个:

You normally don't need to include the @2x in the name - iOS should automatically pick the right filename (some.png or some@2x.png) depending on the scale of the screen. Have you tried this:

[image setImage:[UIImage imageNamed:@"some.png"]];

相反?

这篇关于UIImage imageNamed 不适用于 ios 5.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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