UIView doesn't resize when hiding the statusBar
Everything is in the title, here some things that I tried :
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[self setWantsFullScreenLayout:YES];
[[self view] setNeedsLayout];
CGRect frame = self.view.frame;
frame.size.height += 20.0;
[[self view] setFrame:frame];
Could you tell me what to do? I thing it might be 开发者_StackOverflowsomething else in the code, since with a simple clear project, it's working.
You probably need to change the position of the frame, as well as its height.
frame.origin.y -= 20.0;
frame.size.height +=20.0;
Did you assign values for following properties of UIView?
- @property(nonatomic) BOOL autoresizesSubviews
- @property(nonatomic) UIViewAutoresizing autoresizingMask
I had used Ben's method before for status bar's problem, but I think it should have another elegant way for this.
精彩评论