iOS App未在iPhone 7上使用全屏 [英] iOS App not using full screen on iPhone 7

查看:55
本文介绍了iOS App未在iPhone 7上使用全屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个最初为iPhone 4和5开发的iOS应用.

I have an iOS App originally developed for iPhone 4 and 5.

进行一些更新后,我尝试在iPhone 7(Simulator)上运行它,视图"将不再充满屏幕.它们(包括标题栏)在屏幕的右侧和底部留有黑色空白.

After doing some updates, I tried to run it on iPhone 7 (Simulator), the Views won't fill the screen any more. They (inclusing the title bar) leave a black margin on the right and the bottom of the screen.

我在iPhone 5上发现了很多类似的帖子,但缺少适当的启动图像.但是,我已经将所有可能的启动图像以其正确的大小包含在资产目录中(不再显示警告,),并且当应用程序启动时,启动图像为全屏显示.

I found a lot of similar posts regarding iPhone 5, where an appropriate launch image was missing. Yet, I have included all possible launch images in their correct sizes as asset catalogue (shows no warnings any more, puh), and the when the app is launched, the launch image is fullscreen.

如果我在InterfaceBuilder中更改大小,则布局/视图"将设置为自动布局,并调整好大小.

The Layout/View is set to auto-layout, and resized well, if I change the size in the InterfaceBuilder.

为什么视图无法在iPhone 7上缩放?!?

Why does the View not scale on iPhone 7 ?!?

推荐答案

找到解决方案

在视图的属性检查器"选项卡的模拟度量"类别中,属性大小"设置为自由格式".将其更改为推断"后,调整大小即可.

In the View's "Attributes inspector" tab, in category "Simulated metrics", the attribute "Size" was set to "Freeform". After changing this to "Inferred", the sizing worked.

注意,这种渗漏也应在MainWindow中进行检查.在此更改到达模拟器之前,可能需要进行构建清理.

Note, that this seeting shall be checked in the MainWindow, as well. And it may require a build-clean, before this change reaches the Simulator.

更改大小"也会影响InterfaceBuilder中的设备选择器(不同iPhone和iPad型号的符号),从而使它实际上可以在单击iPhone型号或更改方向时调整大小.从选择器中单击模型.

Changing the "Size" also influenced the device selector in the InterfaceBuilder (the symbols for different iPhone and iPad models), making it actually adjust the size when clicking an iPhone model or changing orientation... Before, nothing had changed when clicking a model from the selector.

这篇关于iOS App未在iPhone 7上使用全屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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