The color of the iOS 7 status bar during a push animation.

My app has a solid gray navigation bar and, to match the design of iOS 7, the status bar needs to be the same color.

To do this, I set edgesForExtendedLayout = UIRectEdgeNone and extendedLayoutIncludesOpaqueBars = YES and set the View controller-based status bar appearance to YES in my plist. To create a gray color for the status bar, I set the background color of my MainWindow to gray. This works well unless there is a push or pop animation. During the animation, the status bar blinks in color and looks like it has a double gray intensity. When the animation ends, it returns to the correct gray color.

Does anyone know what could happen? Should I set the color of the status bar to match the color of the navigation bar differently?

+6
source share
1 answer

Do you use a background image or hue color to set the background of the navigation bar?

If you are using a background image (which sounds like you have a solid gray background), you need to make sure that it has 64 growth points (128 pixels in the retina). If you use the old sizes of iOS 6 (44 points), iOS 7 will back off and not turn on the status bar.

For more information about this case, see Table 5-1, โ€œProcessing changed background images for bars at the top of the screen,โ€ in the iOS 7 transition documentation .

Also, if this is the case, you do not need to set edgesForExtendedLayout , extendedLayoutIncludesOpaqueBars and View controller-based status bar appearance . You may need this for other things, but not for this.

If you want to continue to support iOS 6, you need to have two different background images: one from iOS 7 and above and an outdated version of iOS 6 and below. This should give you the effect you are looking for.

+4
source

Source: https://habr.com/ru/post/954116/


All Articles