iOS 7 Status Bar Turns Black When Overriding UINavigationBar

人走茶凉 提交于 2019-12-08 08:19:17

问题


I am subclassing the UINavigationBar so that I can override the drawRect method. However, when I do so in iOS 7, the status bar becomes completely black. No text at all. In iOS 6 it doesn't have that problem; the status bar is where it should be.

- (void)drawRect:(CGRect)rect // status bar goes pitch black
{
    [super drawRect:rect];
}

If I comment out this method, the status bar returns. How can I get the status bar back?


UPDATE Apr 15, 2014

I tried to set the status bar to something else using the code that I found here but it does not seem to have any effect.


回答1:


A solution I found. The text was initially black on top of a black background. I have not figured out how to make the background transparent, but I guess having white text is good enough.

https://stackoverflow.com/a/18184831/3400034



来源:https://stackoverflow.com/questions/23048768/ios-7-status-bar-turns-black-when-overriding-uinavigationbar

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