0

I've subclassed UINavigationBar to have a default, blurred image there.

I'm overriding the drawRect: method like this:

- (void)drawRect:(CGRect)rect {
    self.backgroundColor = [UIColor blueColor];
}

But as you can see, the color doesn't stretch under the status bar:

enter image description here

Why is this? Usually, the storyboard-created bar would stretch behind the status bar.

Erik
  • 2,500
  • 6
  • 28
  • 49
  • See my answer in https://stackoverflow.com/questions/19061069/make-navigation-bar-stretch-behind-status-bar-in-xcode-5-ios7. This is still applicable – Carien van Zyl Oct 09 '17 at 08:20

1 Answers1

0

This isn't the proper way to change the UINavigationBar color. Refer to Set background color for UINavigationBar

Community
  • 1
  • 1
tgyhlsb
  • 1,905
  • 14
  • 21