在通用(iPad、iPhone、iPod)应用程序开发中测试不同的屏幕分辨率
我注意到,当向应用程序商店提交通用应用程序时,需要支持多种屏幕分辨率。我认为 iPhone/iPod:320x460、320x480、640x960 和 iPad 768x1024。
当我在 Xcode 中指定通用应用程序开发时,模拟器的分辨率为 320x480。要查看768x1024屏幕分辨率,我可以将目标设置更改为iPad,但如何测试320x460和640x960分辨率?
我的默认解决方案是针对 iPad,并手动破解我的代码,例如: SCREEN_WIDTH=640, SCREEN_HEIGHT=960;
但模拟器上肯定应该有一个设置!
在一个相关问题中,有什么方法可以从模拟器中获取屏幕截图(除了 command-shift-3 和裁剪生成的图像之外)?
提前致谢。
I notice when submitting a Universal app to the app store, there are various screen resolutions to support. I think iPhone/iPod: 320x460, 320x480, 640x960 and iPad 768x1024.
When I specify Universal app development in Xcode, the simulator has a resolution of 320x480. To view 768x1024 screen resolution, I can change the target setting to iPad, but how to test 320x460 and 640x960 resolutions?
My default solution is to target iPad, and manually hack my code, e.g.: SCREEN_WIDTH=640, SCREEN_HEIGHT=960;
but surely there should be a setting on the simulator for this!?
In a related question, is there any way to get screen captures off the simulator (apart from command-shift-3 and cropping the resulting image)?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
640x960 是 iPhone 4。您只需在模拟器设备菜单中选择“iPhone 4”即可。您会注意到所有内容都是两倍大(除非您的计算机屏幕很小)。
iPhone 4 仍会根据 [
[UIScreen mainScreen] applicationFrame].size
表示其屏幕为 320x480,请参阅 此处进行讨论。460x320 是标准 iPhone/iPod Touch 屏幕减去状态栏的尺寸。您不需要单独支持 480x320。
注意:在最近的模拟器版本中,“iPhone 4”选项已重命名为“iPhone(Retina)”。
我认为没有更好的方法来从模拟器中获取屏幕截图。
640x960 is an iPhone 4. You can simply select "iPhone 4" in the simulator device menu. You'll notice everything is twice as big (unless your computer has a small screen).
The iPhone 4 will still say its screen is 320x480 according to [
[UIScreen mainScreen] applicationFrame].size
see here for a discussion.460x320 is the standard iPhone/iPod Touch screen minus the size of the status bar. You don't need to support it separately from 480x320.
Note: The "iPhone 4" option has been renamed "iPhone (Retina)" in recent simulator versions.
I don't think there is a better way to get screen captures off the simulator.