本文介绍了图像显示在模拟器上,但不是在真正的iPhone上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我得到了这段代码,我想在我的视图上显示一张图片:
So I got this piece of code, I want to show a picture on my view:
imgLogo = [[UIImageView alloc] init];
[imgLogo setFrame:CGRectMake(60, 200, 200, 200)];
[imgLogo setImage:[UIImage imageNamed:@"MyFrigginAwesomeLogo"]];
[self.view addSubview:imgLogo];
但问题是它在模拟器(iOS 7)上测试时能正常工作但它没有在我的iPhone上显示任何内容(iOS7为4S)。
But the problem is that it works correctly when testing it on the simulator(iOS 7) but it doesn't show anything on my iPhone(4S with iOS7) itself.
推荐答案
从评论中添加答案:
iOS设备区分大小写,但模拟器不是。确保您正在尝试加载确切的文件名以便找到它们。
The iOS devices are case sensitive, but the simulator is not. Make sure you are trying to load the exact filename in order for them to be found.
这篇关于图像显示在模拟器上,但不是在真正的iPhone上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!