iOS App not using full screen on iPhone 7

こ雲淡風輕ζ 提交于 2021-02-10 20:18:09

问题


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

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.

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.

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

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


回答1:


Try to add splash screen image to project with following name instead of assets folder.

Default-568h.png                   320 x 568      
Default-568h@2x.png                640 x 1136  
Default-667h@2x.png                750 x 1334
Default-736h@3x.png                1242 x 2208
Default.png                        320 x 480
Default@2x.png                     640 x 960 



回答2:


Found Solution

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.

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.

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.




回答3:


yes that was also working but in this question launchscreen are mentioned so i have gives answer according to that point.



来源:https://stackoverflow.com/questions/43835420/ios-app-not-using-full-screen-on-iphone-7

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