Change UIViewController self.view frame
ios, objective-c, uiview, uiviewcontroller
Solution
Set the frame in `viewWillAppear`
- (void)viewWillAppear:(BOOL)animated
{
self.view.frame = CGRectMake(0, 44, 320, 416);
[super viewWillAppear:animated];
}
Problem
I am trying to display a viewController xib view with its view displayed under a fixed header banner (0,0,320,44) which is an imageView added on Application window. This is because I need it to stick on the screen while I navigate multiple view controllers. Its a requirement of the project I am doing. So far I have tried: Resizing the XIB view to the appropriate frame size (0,0,320,416), both with dot notation and setter. Changing the frame in viewDidLoad with self.view.frame = CGRectMake(0, 44, 320, 416); but it is not working. Any suggestion?