Search code examples
iphoneiosstatusbaruiwindowcgrect

Blank space below the status bar


In app delegate I use [[UIScreen mainScreen] bounds] (which is by default) to set frame for the window.

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

But when I try to launch the app, I see blank space between my view and the status bar. enter image description here

If I set the frame this way

CGRect bounds = [[UIScreen mainScreen] bounds];
self.window = [[UIWindow alloc] initWithFrame:CGRectMake(0.0, -20.0, bounds.size.width, bounds.size.height)];

It'll be ok, but it won't detect taps at the bottom 20 points of the screen.

What's wrong here? Please help.

P.S. I don't use IB, don't set frame for any view except window (because it doesn't help).


Solution

  • Solved by setting the property wantsFullScreenLayout of the root view controller to YES.

    P.S. It's not my first app where I write application:didFinishLaunchingWithOptions: from scratch, but I never had this problem...