I am displaying a UIWindow over the UIStatusBar
, by default the UIStatusBarStyle
is set to UIStatusBarStyleLightContent
, but when I display the UIWindow
the UIStatusBarStyle
switches to the black style.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
This was a fairly trivial problem that I found to be resolved setting
modalPresentationCapturesStatusBarAppearance
totrue
.Did you set the "View controller-based status bar appearance" property in yourAppName-Info.plist to NO ?
Add this so when the view appears it will set the colour/style
I came across this topic while struggling with the same problem. What you have to do is create a new view controller and set it as the root view controller of your
UIWindow
(that is theUIWindow
that you are displaying over your other view). Then, in this new view controller implement thepreferredStatusBarStyle
method like this:Alternatively, you can set the "View controller-based status bar appearance" property in Info.plist to NO and implement the
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]
method as Azabella suggested. However, this will set the Status Bar of all your views to white. If that's no problem, then there's no need to make a separate view controller just to set thepreferredStatusBarStyle
method.