Quote:
Originally Posted by Sayid Cohen
The following code solve it for me:
Code:
- (void)viewWillAppear:(BOOL)animated {
// to fix the controller showing under the status bar
self.view.frame = [[UIScreen mainScreen] applicationFrame];
}
|
==CONFIRMED== The above suggestion worked. In detail, in the context of the most simple Hello World example, which is in the context of the code I posted higher up, here's what I did. I found in MyViewController.m the function viewDidLoad, that was put there automagically by XCode when the class was created, but was commented out. I removed the comment-out to restore the code, then added the appropriate code inside:
Code:
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
self.view.frame = [[UIScreen mainScreen] applicationFrame];
[super viewDidLoad];
}
And that fixed the problem.
==WHAT THIS MEANS== in essence is that the tutorial falls short of being purely "correct" and should have included this or a similar fix. Perhaps ==MORE TO THE POINT==, XCode should have put that code in there, running not commented out.