質問

I set an UINavigationBar background tint by appearance using macro color:

[[UINavigationBar appearance] setBarTintColor:UIColorFromRGB(0x6DBEE8)];

And in whole navigation based application but in my UIModalViewController does not work:

In my plist i have : View controller-based status bar appearance : YES

and globally i set appearance : [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

Here it what it's look like: enter image description here

役に立ちましたか?

解決

That is because in iOS7, the height of UINavigationBar is increased (64 points) when it is contained in a UINavigationController. With the status bar being transparent,when you are presenting a view controller modally, its not in the UINavigationController so the height is normal (44 points) and thus the map view is behind the status bar. You need to handle this in your modal view controller. You can:

  • Hide the status bar altogether (works but might not be preferable in every situation)
  • Put a view behind the navigation bar and where the status bar is with the same background color.
  • Change the color of the view controller's view itself to the desired color and offset the y position of your map view to accommodate the status bar's height.
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top