File tree Expand file tree Collapse file tree 3 files changed +7
-40
lines changed
Expand file tree Collapse file tree 3 files changed +7
-40
lines changed Original file line number Diff line number Diff line change @@ -978,28 +978,8 @@ export class View extends ViewCommon {
978978 }
979979
980980 updateStatusBarStyle ( value : 'dark' | 'light' ) {
981- // Keep UINavigationBar style aligned (affects legacy + some container defaults).
982- const parent = this . parent ;
983- const ctrl = parent ?. ios ?. controller ;
984- if ( ctrl && ctrl instanceof UINavigationController ) {
985- const navigationBar = ctrl . navigationBar ;
986- if ( navigationBar ) {
987- navigationBar . barStyle = value === 'light' ? UIBarStyle . Black : UIBarStyle . Default ;
988- }
989- }
990-
991981 // iOS requires a controller invalidation to re-evaluate `preferredStatusBarStyle`.
992982 const ownerController = this . viewController || IOSHelper . getParentWithViewController ( this as any ) ?. viewController ;
993-
994- // Force overrideUserInterfaceStyle if available (iOS 13+) to ensure status bar contrast.
995- if ( SDK_VERSION >= 13 && ownerController ) {
996- const style = value === 'light' ? UIUserInterfaceStyle . Dark : UIUserInterfaceStyle . Light ;
997- ownerController . overrideUserInterfaceStyle = style ;
998- if ( ctrl && ctrl instanceof UINavigationController ) {
999- ctrl . overrideUserInterfaceStyle = style ;
1000- }
1001- }
1002-
1003983 IOSHelper . invalidateStatusBarAppearance ( ownerController , `View.updateStatusBarStyle:${ value } ` ) ;
1004984 }
1005985
Original file line number Diff line number Diff line change @@ -151,15 +151,14 @@ class UILayoutViewController extends UIViewController {
151151 // @ts -ignore
152152 public get preferredStatusBarStyle ( ) : UIStatusBarStyle {
153153 const owner = this . owner ?. deref ( ) ;
154- if ( owner ) {
154+ if ( owner ?. statusBarStyle ) {
155155 if ( SDK_VERSION >= 13 ) {
156- return owner . statusBarStyle === 'dark ' ? UIStatusBarStyle . DarkContent : UIStatusBarStyle . LightContent ;
156+ return owner . statusBarStyle === 'light ' ? UIStatusBarStyle . LightContent : UIStatusBarStyle . DarkContent ;
157157 } else {
158- return owner . statusBarStyle === 'dark ' ? UIStatusBarStyle . LightContent : UIStatusBarStyle . Default ;
158+ return owner . statusBarStyle === 'light ' ? UIStatusBarStyle . LightContent : UIStatusBarStyle . Default ;
159159 }
160- } else {
161- return UIStatusBarStyle . Default ;
162160 }
161+ return UIStatusBarStyle . Default ;
163162 }
164163}
165164
Original file line number Diff line number Diff line change @@ -359,15 +359,14 @@ class UIViewControllerImpl extends UIViewController {
359359 // @ts -ignore
360360 public get preferredStatusBarStyle ( ) : UIStatusBarStyle {
361361 const owner = this . _owner ?. deref ( ) ;
362- if ( owner ) {
362+ if ( owner ?. statusBarStyle ) {
363363 if ( SDK_VERSION >= 13 ) {
364364 return owner . statusBarStyle === 'light' ? UIStatusBarStyle . LightContent : UIStatusBarStyle . DarkContent ;
365365 } else {
366- return owner . statusBarStyle === 'dark ' ? UIStatusBarStyle . LightContent : UIStatusBarStyle . Default ;
366+ return owner . statusBarStyle === 'light ' ? UIStatusBarStyle . LightContent : UIStatusBarStyle . Default ;
367367 }
368- } else {
369- return UIStatusBarStyle . Default ;
370368 }
369+ return UIStatusBarStyle . Default ;
371370 }
372371}
373372
@@ -457,17 +456,6 @@ export class Page extends PageBase {
457456 const frame = this . frame ;
458457 if ( frame ?. ios && value ) {
459458 const navigationController : UINavigationController = frame . ios . controller ;
460- const navigationBar = navigationController . navigationBar ;
461-
462- navigationBar . barStyle = value === 'light' ? UIBarStyle . Black : UIBarStyle . Default ;
463-
464- // Force overrideUserInterfaceStyle on the navigation controller as well
465- if ( SDK_VERSION >= 13 ) {
466- const style = value === 'light' ? UIUserInterfaceStyle . Dark : UIUserInterfaceStyle . Light ;
467- navigationController . overrideUserInterfaceStyle = style ;
468- navigationBar . overrideUserInterfaceStyle = style ;
469- }
470-
471459 IOSHelper . invalidateStatusBarAppearance ( navigationController , `Page._updateStatusBarStyle:${ value } ` ) ;
472460 }
473461 }
You can’t perform that action at this time.
0 commit comments