mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(ios): ease of use on explicit preferredStatusBarStyle
Allows statusBarStyle to be defined on any view for explicit per view control, whether presented in modal or not. Note: You must remove Info.plist key `UIViewControllerBasedStatusBarAppearance` It defaults to true when not present: https://developer.apple.com/documentation/bundleresources/information-property-list/uiviewcontrollerbasedstatusbarappearance Or you can explicitly set it to true: <key>UIViewControllerBasedStatusBarAppearance</key> <true/> False value will make this property have no effect.
This commit is contained in:
@@ -349,7 +349,11 @@ class UIViewControllerImpl extends UIViewController {
|
||||
public get preferredStatusBarStyle(): UIStatusBarStyle {
|
||||
const owner = this._owner?.deref();
|
||||
if (owner) {
|
||||
return owner.statusBarStyle === 'dark' ? UIStatusBarStyle.LightContent : UIStatusBarStyle.Default;
|
||||
if (SDK_VERSION >= 13) {
|
||||
return owner.statusBarStyle === 'dark' ? UIStatusBarStyle.DarkContent : UIStatusBarStyle.LightContent;
|
||||
} else {
|
||||
return owner.statusBarStyle === 'dark' ? UIStatusBarStyle.LightContent : UIStatusBarStyle.Default;
|
||||
}
|
||||
} else {
|
||||
return UIStatusBarStyle.Default;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user