问题
In my app I want to change only one view controller status bat to hidden.
So in the view did load method I added this:
- (BOOL)prefersStatusBarHidden
{
return YES;
}
Thats what allot of the guides online said to do.
Now, this view controller is a table view, and I have set its nav bar background image to something custom, it looks like this before Im hiding the status bar:
And after I added the hidden method:
So you can see it cuts part of the bg image (with the green line).
my nav bar bg image size is 640 × 128
and I put it on X2 in xcode, so this should cover the whole nav bar after hiding the status bar.....isn't it?
please help,
Thanks!
回答1:
The status bar is 20 pixel in hight so either you need to programmatically increase the size on the UINavigation controller hight just for that view controller of you need a smaller background image for that view controller.
来源:https://stackoverflow.com/questions/29716164/setting-status-bar-hidden-is-messing-with-my-navigation-bar-background-image-siz