-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bicolor Status Bar Bug #6506
Labels
Comments
Modifying diff --git a/lib/ios/RNNBasePresenter.m b/lib/ios/RNNBasePresenter.m
index a4bf12294..f3fc3a099 100644
--- a/lib/ios/RNNBasePresenter.m
+++ b/lib/ios/RNNBasePresenter.m
@@ -90,19 +90,7 @@ - (void)viewDidLayoutSubviews {
}
- (UIStatusBarStyle)getStatusBarStyle {
- RNNNavigationOptions *withDefault = [self.boundViewController.resolveOptions withDefault:[self defaultOptions]];
- NSString* statusBarStyle = [withDefault.statusBar.style getWithDefaultValue:@"default"];
- if ([statusBarStyle isEqualToString:@"light"]) {
- return UIStatusBarStyleLightContent;
- } else if (@available(iOS 13.0, *)) {
- if ([statusBarStyle isEqualToString:@"dark"]) {
- return UIStatusBarStyleDarkContent;
- } else {
- return UIStatusBarStyleDefault;
- }
- } else {
- return UIStatusBarStyleDefault;
- }
+ return UIStatusBarStyleDarkContent;
}
- (UINavigationItem *)currentNavigationItem {
@@ -114,12 +102,6 @@ - (UIInterfaceOrientationMask)getOrientation {
}
- (BOOL)getStatusBarVisibility {
- RNNNavigationOptions *withDefault = [self.boundViewController.resolveOptions withDefault:self.defaultOptions];
- if (withDefault.statusBar.visible.hasValue) {
- return ![withDefault.statusBar.visible get];
- } else if ([withDefault.statusBar.hideWithTopBar getWithDefaultValue:NO]) {
- return self.boundViewController.stack.isNavigationBarHidden;
- }
return NO;
}
|
It seems to be timing related as doing a NSThread sleep inside - (UIStatusBarStyle)getStatusBarStyle {
[NSThread sleepForTimeInterval:0.01f];
return UIStatusBarStyleDarkContent;
} |
Setting the NSThread sleep to larger values (tested |
guyca
pushed a commit
that referenced
this issue
Sep 1, 2020
It appears that UIViewController's delegate methods `preferredStatusBarStyle` and `prefersStatusBarHidden` needs to run faster than it does now. So instead of resolving all the options object, I changed it to resolve only the `statusBar` options object, which fix's the issue. Closes #6506
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
Multiple calls to
Navigation.setRoot
lead to the status bar becoming bicolor (text white, icons black).Steps to Reproduce / Code Snippets / Screenshots
Easily reproducible with current playground (https://github.com/wix/react-native-navigation/tree/6022f434a8b4cd4a1b03f1f9f2a13e6912b7e07e):
Now
Navigation.setRoot
is called every 5 seconds in the playground app, leading to the bicolor status bar.Environment
The text was updated successfully, but these errors were encountered: