简体   繁体   中英

Why my view is not in fullscreen mode?

I make some apps but this particular one in not in fullscreen mode, and I have no idea how to fix it. Look at the top and bottom of the screen, with two "black belts"

在此处输入图片说明

It's artefact of times when iPhone 5 came out.

iPhones before 5 had exactly same screen ratio, but iPhone 5 was taller/higher/longer.

Most of the existing at a device launch time apps weren't aware about this screen size change.

So in order to keep them look pretty iOS (6+) just add those black bars if screen doesn't have original ratio and app doesn't seem to know about different screens. And app works with screen like it's 2008-2012.

But how does iOS defines if app supports iPhone 5 and so on screen ratios? By checking if launch screen for iPhone Retina (4'') exist, ofc.

When you set "0" as a constraint, make sure to also uncheck "Constraint to Margins". The margins are invisible but are usually ~20 pixels wide on ever side of the view frame. By keeping your constraint in these margins, it makes sure that your image is never too big to fit on the screen, however, this is usually not what is intended.

You have to add Launch Screen File as storyboard.

Tap on your project in Project navigator, next tap on App target and set some storyboard with one UIViewController (it should be Initial View Controller) as your Launch Screen File.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM