在这个时候,大家都知道,如果你有一个名为“football.png”的图像,并希望支持Retina display,你应该将图像的大小加倍,并将其称为“[email protected]”。
我的问题是,如果有一些iPad,像*football@iPad_which_is_another_size.png*?
如果没有办法这样做,我必须将每个图像连接到IBOutlet并以编程方式设置框架?
解决方法In iOS 4.0 and later,it is possible
to mark indivIDual resource files as
usable only on a specific type of
device
To associate a resource file with a
particular device,you add a custom
modifIEr string to its filename. The
inclusion of this modifIEr string
yIElds filenames with the following
format:
<basename><device>.<filename_extension>
要加载iPad的具体资源,你应该使用〜ipad。示例:创建名为AwesomeImage〜ipad.png的图像,并使用[UIImage imagenamed:@“AwesomeImage.png”]加载,就像您对视网膜显示图像一样。
欲了解更多信息:http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/LoadingResources/Introduction/Introduction.html在“iOS支持设备特定资源”部分。
总结以上是内存溢出为你收集整理的objective-c – 在Xcode中指定iPad的图像,例如@ 2x for iPhone 4全部内容,希望文章能够帮你解决objective-c – 在Xcode中指定iPad的图像,例如@ 2x for iPhone 4所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)