Rightpoint / Anchorage

A collection of operators and utilities that simplify iOS layout code.
MIT License
627 stars 46 forks source link

View could not display in full-screen size, black gap on top and also at bottom #54

Closed InfinityCode777 closed 6 years ago

InfinityCode777 commented 6 years ago

Hi, guys,

I met a problem when I was following the tutorial on how to build an IB-free app, https://www.raizlabs.com/dev/2016/08/ib-free-living-without-interface-builder/, after I finish configuring my AppDelegate Info.plist and my VC. The view could not display in full-screen size, there is black gap on top and another on at the bottom.

I check all the files, it seems all right. I created another project and did it again and everything works.

I am just curious where the bug is. So I will really appreciate the help if anyone could spend a couple minutes to look at my code at

https://github.com/InfinityCode777/LearnIBFree

SHA: f52b165905f780c00490c6b037b2d13d6fbb1ea1

The screen snapshot of iPhone8Plus simulator is contained in repo above.

Best

Jing

mittorn commented 6 years ago

Same trouble when i removed storyboard from SDL2 project. It does not launch fullscreen, leaving black gaps. How to workaround it?

ZevEisenberg commented 6 years ago

Hey @InfinityCode777, thanks for writing in, and thanks for checking out our blog post! I think I see the problem: you removed the launch storyboard as part of the tutorial, but if you don't have a launch storyboard, and don't have a launch image specified, the app will always run at 320x480, like a 3.5" iPhone, even on larger phones. That's why you're seeing a gap.

You can't use the xibless approach to do a launch screen in code, so you'll have to either use a storyboard or a launch image to get the app to grow to fit the device it's running on.