In iOS6, The statusbar color is determined by the UINavigationBar of the current page, that is, the UINavigationBar in the current view determines the tintColor of statusbar. If our UIViewController is a subset of UINavigationController, the color of statusbar is fine. If the UINavigationBar is dropped by hide or there is no UINavigationController at all, the color of statusbar on iOS6 is black.
What should we do? How can we set the statusbar color on iOS6?
As mentioned earlier, the color of statusbar is determined by UINavigationBar. Can we set a UINavigationBar in the current view to affect the color of statusbar. Our assumptions are correct. This method is indeed feasible.
Put a UINavigationBar in our view and set its frame = CGRectMake (0,-43,320, 44 ); here, the value of y must be-43 (The UINavigationBar has a pixel value), otherwise it will not achieve the same effect.
In this way, the expected result is displayed.