Testing different screen resolutions in Universal (iPad,iPhone,iPod) app development

泄露秘密 提交于 2019-12-11 14:36:52

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/4393778/testing-different-screen-resolutions-in-universal-ipad-iphone-ipod-app-develop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!