iOS 7 Status Bar Turns Black When Overriding UINav

2019-05-30 13:19发布

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?

ios 7 with the drawRect override

ios 6 with the drawRect override


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条回答
成全新的幸福
2楼-- · 2019-05-30 14:14

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

查看更多
登录 后发表回答