What is the programmatical equivalent to UIViewController
's Resize View From NIB when editing a storyboard in Xcode's Interface Builder?
I want to set this to no for a view controller that uses a xib file instead of a storyboard.
There is no method in UIViewController
that is meant to be mapped to that IB property. However, since it affects the size and position of the top-level view in relation to the status bar, the programmatic equivalent would probably be the following, if the status bar is visible:
int statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
CGRect viewFrame = self.view.frame;
self.view.frame = CGRectMake(0, statusBarHeight, viewFrame.size.width, viewFrame.size.height - statusBarHeight);
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