Setting a hidden status bar is messing around with my image size background in the navigation bar

In my application, I want to change only one status of the bat status of the control controller to hidden.

So, in the view, the method that I added was loaded:

- (BOOL)prefersStatusBarHidden { return YES; } 

Here's what the online guide said.

Now this view controller is a table view, and I set its background image on the navigation bar to something normal, it looks like this before I hide the status bar:

enter image description here

And after I added the hidden method:

enter code here

So, you can see that it cuts part of the bg image (with a green line).

my nav bar bg is an image size of 640 × 128 , and I put it on X2 in xcode, so this should cover the entire navigation bar after hiding the status bar ..... isn't it?

please, help,

Thanks!

0
source share
1 answer

The status bar is 20 pixels high, so you need to programmatically increase the size at the height of the UINAVigation controller, only for this view controller you will need a smaller background image for this view controller.

0
source

All Articles