Skip to content

Commit 6a5664b

Browse files
fix(ios): statusbar ui issue fixed (#11458)
* fix(ios): statusbar ui issue fixed * fix(ios): updated constant
1 parent 0939b69 commit 6a5664b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

iphone/Classes/TiUIiOSProxy.m

+17
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ - (void)setStatusBarBackgroundColor:(id)value
142142
}
143143
view.frame = frame;
144144
view.backgroundColor = [[TiUtils colorValue:value] _color];
145+
[[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(windowDidBecomeKey:) name:UIWindowDidBecomeKeyNotification object:nil];
145146
#endif
146147
} else {
147148
UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
@@ -206,6 +207,8 @@ - (NSNumber *)PREVIEW_ACTION_STYLE_SELECTED
206207

207208
- (void)dealloc
208209
{
210+
[[NSNotificationCenterdefaultCenter] removeObserver:self];
211+
209212
[superdealloc];
210213
}
211214

@@ -258,6 +261,20 @@ - (void)didReceiveMemoryWarning:(NSNotification *)notification
258261
[superdidReceiveMemoryWarning:notification];
259262
}
260263

264+
#if IS_SDK_IOS_13
265+
- (void)windowDidBecomeKey:(NSNotification *)notification
266+
{
267+
if ([TiUtils isIOSVersionOrGreater:@"13.0"]) {
268+
UIWindow *keyWindow = UIApplication.sharedApplication.keyWindow;
269+
CGRect frame = keyWindow.windowScene.statusBarManager.statusBarFrame;
270+
UIView *view = [keyWindow viewWithTag:TI_STATUSBAR_TAG];
271+
if (view) {
272+
view.frame = frame;
273+
}
274+
}
275+
}
276+
#endif
277+
261278
#ifdef USE_TI_UIIOSALERTDIALOGSTYLE
262279
- (TIUIiOSAlertDialogStyleProxy *)AlertDialogStyle
263280
{

0 commit comments

Comments
 (0)
close