什么设置决定了应用程序是否针对iPhone 6和6plus进行了扩展? [英] What setting determines whether an app gets scaled for iPhone 6 and 6plus?

查看:139
本文介绍了什么设置决定了应用程序是否针对iPhone 6和6plus进行了扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,当我在iPhone 6的模拟器上运行我的项目时,部署目标为7.1我希望所有内容都能自动缩放以获得更大的屏幕尺寸。



但这不会发生。我的UILabel之前水平位于320px宽的故事板屏幕的中心,对父视图具有前导空间约束,现在在模拟器中显示正好具有空间约束,而不是缩放。所以它显示偏离中心,因为iPhone6更宽。



什么设置决定应用程序是否针对iPhone 6和iPhone 6+进行了缩放???



Paul G 。

解决方案

好的,我找到了:



什么在iOS8上



的新< 为了让系统知道您的应用程序支持iPhone 6屏幕大小,请在应用程序包中添加一个故事板启动屏幕文件。在运行时,系统会查找故事板启动屏幕文件。如果存在这样的文件,系统假定您的应用程序明确支持iPhone 6和6 Plus并以全屏模式运行。如果没有此类图像,系统会报告较小的屏幕尺寸(320 x 480点或320 x 568点),以便您的应用程序的基于屏幕的计算继续是正确的。然后缩放内容以适应更大的屏幕。



所以我删除了LaunchImage.xib (这是自动放在那里)我删除了plist中的条目。


So when I run my project on the simulator for iPhone 6, with a deployment target of 7.1 I'm expecting everything to Scale automatically for the larger screen size.

But this is not happening. My UILabel which was previously horizontally in the center of a 320px wide storyboard screen, with a leading space constraint to the parent view, now shows up in the simulator with exactly that space constraint, instead of it being scaled. So it shows up off center, because the iPhone6 is wider.

What setting determines whether the app get's scaled for iPhone 6 and iPhone 6+ ???

Paul G.

解决方案

Ok, I found it:

What's new in iOS8

"To let the system know that your app supports the iPhone 6 screen sizes, include a storyboard launch screen file in your app’s bundle. At runtime, the system looks for a storyboard launch screen file. If such an file is present, the system assumes that your app supports the iPhone 6 and 6 Plus explicitly and runs it in fullscreen mode. If such an image is not present, the system reports a smaller screen size (either 320 by 480 points or 320 by 568 points) so that your app’s screen-based calculations continue to be correct. The contents are then scaled to fit the larger screen."

So I removed LaunchImage.xib (which was put there automatically) and I removed the entry for that in the plist.

这篇关于什么设置决定了应用程序是否针对iPhone 6和6plus进行了扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆