iPhone 4 显卡

标签 iphone objective-c

我想为我的应用程序设计背景图像。图像应填满 iPhone 屏幕。 什么图像尺寸适用于 3G 和 4G?

A) 320 x 480。 B) 640 x 960。

我更喜欢使用 B,因为它的质量更高,3G 会调整图像大小以适应吗?

感谢您的帮助。

最佳答案

只需创作两种尺寸并使用 @2x 保存高分辨率。文件名中的后缀(如 background.png<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="472526242c20352832292307753f69372920" rel="noreferrer noopener nofollow">[email protected]</a> )。 iPhone 4 将使用高分辨率图像,较旧的设备将坚持使用普通图像。请参阅 +[UIImage imageNamed: 的文档:

This method looks in the system caches for an image object with the specified name and returns that object if it exists. If a matching image object is not already in the cache, this method loads the image data from the specified file, caches it, and then returns the resulting object.

On a device running iOS 4 or later, the behavior is identical if the device’s screen has a scale of 1.0. If the screen has a scale of 2.0, this method first searches for an image file with the same filename with an @2x suffix appended to it. For example, if the file’s name is button, it first searches for button@2x. If it finds a 2x, it loads that image and sets the scale property of the returned UIImage object to 2.0. Otherwise, it loads the unmodified filename and sets the scale property to 1.0. See iOS Application Programming Guide for more information on supporting images with different scale factors.

另请阅读 appropriate part iOS 应用程序编程指南。

关于iPhone 4 显卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3781923/

相关文章:

iphone - 自定义 UITabBar 和 ViewController 之间的空间

iphone - iphone 上的背景附件 :fixed ?

iphone - AudioQueue 样本值错误

iphone - ipad预编译器

iphone - 计算两个日期之间的差异的问题

ios - 如何使用更新后的数据刷新 NSManagedObject - Core Data

iphone - 如何以编程方式更改 View 的 UIColor

ios - UICollectionView 接收到具有不存在的索引路径的单元格的布局属性

ios - UIActionSheet 不显示行分隔符

objective-c - 使用 PHImageManager,是否可以在一次调用中从一组 PHAssets 请求一组 UIImages?