Setting status bar hidden is messing with my navigation bar background image size

。_饼干妹妹 提交于 2019-12-12 04:48:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!