我应该使用什么尺寸的图像才能支持两种 iPhone 分辨率?
我有一些关于屏幕分辨率的问题,我不清楚。这些问题假设我的应用程序将在 iOS 4.0 及更高版本以及 iPhone 3GS 或 iPhone 4 上运行。
启动图像 (default.png) 的大小应该是 (960x640) 还是 (480x320)?
应用程序图标 (Icon.png) 的大小应该是 (57x57) 还是 (114x114)?
我可以在应用程序中使用的其他图形(例如代表按钮的图形)怎么样?我是否应该始终以更高分辨率创建这些图像,并让应用程序将其缩小?换句话说,如果我希望在 3GS 上显示 200x40 的按钮图像 - 我是否应该创建 400x80 的图像,以便 iPhone 4 可以利用它?
谢谢!
I have a few questions about screen resolution, that I'm not clear on. These questions assume they my app will be running on iOS 4.0 and up, and on either iPhone 3GS or iPhone 4.
Should the size of the splash image (default.png) be (960x640) or (480x320)?
Should the size of the app icon (Icon.png) be (57x57) or (114x114)?
What about other graphics that I may use in my app, such a graphic that represents a button? Should I always create these images for the higher resolution, and have the app scale them down? In other words, if I want a button image to be displayed on the 3GS that is 200x40 - should I create the image at 400x80, so that iPhone 4 can take advantage of it?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可以在这里找到一个很好的指南: http://mobile.tutsplus.com/tutorials/iphone/preparing-your-iphone-app-for-higher-resolutions/
一般来说,您只需创建 2 组图像。你原来的,然后是两倍大的新的,名称中带有@2x。因此,对于尺寸为 32x32 的 image.png,您将得到一个分辨率两倍的 [email]受保护],尺寸为 64x64。在您的应用程序中,始终在 Interface Builder 中以及在代码中加载时使用 image.png。
无需检测设备。这些图像将由操作系统自动拾取并根据需要进行替换。
相关问题:
A good guide to this can be found here: http://mobile.tutsplus.com/tutorials/iphone/preparing-your-iphone-app-for-higher-resolutions/
In general you just create 2 sets of images. Your original and then a new one twice as big with @2x in the name. So for image.png at size 32x32 you would have one that is twice the resolution called [email protected] at size 64x64. In your app just always use the image.png in Interface Builder and when loading in code.
There is no need to detect the device. These images will automatically be picked up by the OS and subbed in as necessary.
Related Questions:
如果您希望它们看起来不错,则需要同时提供两者。例如,
Default.png -> (480x320)
Amd
[电子邮件受保护] -> (960x640)
You need to provide both if you want them to look nice. For example,
Default.png -> (480x320)
Amd
[email protected] -> (960x640)