我有一个应用程序,在 iPhone 6 中我希望它按比例缩放。 基本上我想从设置中模仿应用缩放。目前,当我在设置中使用缩放模式运行应用程序时,一切正常,但当我在设置中不使用缩放模式运行它时,显示的 View 较小。我该如何解决?
最佳答案
来自 Apple 的 What's New in iOS文档:
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.
如果您不提供启动屏幕文件(也不提供 iPhone 6 和 6 Plus 的启动屏幕图像),您的应用将缩放而不是在全屏模式下运行。
Apple 确实建议使用大小类和自动布局,以便您的应用程序的 UI 能够适应。您的用户可能对您选择缩放应用不满意,因为您不会在这些较新的设备上利用更大的屏幕尺寸。
关于ios - 在 iOS9 中强制缩放应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32695120/