Differences in simulator vs deployment on iPad

2019-07-18 09:44发布

I just deployed my iPhone app to my iPad 2 (only iOS device I've got) and was surprised to see this difference (among other, functional, differences that I'll address in another post if I can't figure them out) in how each system displays the thing.

The app was developed for iOS 7, iPhone retina 4", using Xcode 5.1 on a Macbook Pro. I deployed to a non-retina 2011 iPad 2.

First, the full screenshot from the iPad:

enter image description here

Now, the iPad version cropped to just the iPhone screen vs the display in the sim:

enter image description here

Questions:

1) Is this the normal display for an iPhone app on an iPad?

2) Can I change it?

3) Why is it cutting the bottom off the screen?

Any ideas?

Thanks!

1条回答
可以哭但决不认输i
2楼-- · 2019-07-18 10:18

Even if you are running it in a 4" iPhone Simulator, it doesn't mean that people are not able to use it in a 3.5" iPhone.

So, answering your questions:

  1. Yes. When you are developing an iPhone only app and running it in an iPad, the behaviour is to display it centered in the middle of the screen and present a 2x button to zoom on it (retina iPads only). For non-retina iPads, the behaviour is to display it in 2x mode and there is no way to change it, because it doesn't have enough pixel density to display it (from https://stackoverflow.com/a/18970516/805647).

  2. To change it, you must create an Universal application and create layouts for both devices.

  3. It is cutting because the screen aspect ratio of those devices are different. For a 4" iPhone it is 16:9 and for an iPad, it is 4:3.

You can see a screen comparison here: http://www.iosres.com

查看更多
登录 后发表回答