Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的应用程序中,我使用的是 iPhone 6 模拟器和 xcode 4.6。我在我的应用程序中添加了一个背景imageView,这里我有两张图片,myPic.png(320*480)和myPic@2x.png(640*960),但是系统只显示myPic.png图片显示高质量的图片。谁能告诉我,谢谢!
当您在视网膜显示器上运行项目时,它将显示 2x 图像而不是小图像。为此,您必须像这样编写代码。
UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake(270, 17, 30, 30)]; imageView.image = [UIImage imageNamed:@"myPic"];
不要写图像的扩展名,这样它就会根据你的屏幕显示图像。