I have a subclass of UIViewController and the height is always 460 (self.view.frame.size.height). I don't have the status bar in place, and so I want it to be 480?? Is there a way so that it can return 480?
You could do it like this:
- (void)viewDidLoad
{
// View setup
// Ensure the view will keep filling its parent
// when the parent view resizes (e.g. device rotation).
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
}
- (void)viewWillAppear:(BOOL)animated
{
// Force to fill the parent once the view is about to be shown.
self.view.frame = self.view.superview.bounds;
}
If you would use a XIB you'd set the autoresizing mask in Interface Builder instead.
You can set like this
self.view.frame=CGRectMake(0, 0,320, 480);
inside viewdidLoad or loadView
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With