Neznajka
Neznajka

Reputation: 305

background image in navigationbar go to the top of screen

Why background image appear under the top line, where I can see time, charge of battery and other information. This line in other app is black. I mean next

enter image description here

So I create navigation controller in storyboard

enter image description here

So i have next code, first it was in viewDidLoad

enter image description here

my backGroundLayer is 320x44

Upvotes: 0

Views: 1137

Answers (2)

bvogelzang
bvogelzang

Reputation: 1415

The status bar changes to match the color of the background image set. If you do not want this to occur you can set the status bar style to black translucent using the code below or change it in your Xcode project under iPhone/iPod Deployment Info -> Status Bar.

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];

Upvotes: 0

LesPaul
LesPaul

Reputation: 13

The status bar (reception, time, battery charge, etc.) and the navigation bar (title, back buttons, etc.) are two completely different areas in an app. [self.navigationBar setBackgroundImage] only controls the appearance of the navigation bar. If you want to change the appearance of the status bar, click on your Xcode project and go to iPhone/iPod Deployment Info > Status Bar. There, you can change the appearance of the status bar, including the colour, background, and visibility.

Upvotes: 1

Related Questions