Browse Source

statusBarStyle support

yogevbd 6 years ago
parent
commit
66c18fbf6f

+ 1
- 0
lib/ios/RNNNavigationOptions.h View File

@@ -34,6 +34,7 @@ extern const NSInteger TOP_BAR_TRANSPARENT_TAG;
34 34
 @property (nonatomic, strong) id orientation;
35 35
 @property (nonatomic, strong) NSNumber* statusBarBlur;
36 36
 @property (nonatomic, strong) NSNumber* statusBarHideWithTopBar;
37
+@property (nonatomic, strong) NSString* statusBarStyle;
37 38
 @property (nonatomic, strong) NSNumber* popGesture;
38 39
 @property (nonatomic, strong) UIImage* backgroundImage;
39 40
 @property (nonatomic, strong) UIImage* rootBackgroundImage;

+ 2
- 0
lib/ios/RNNNavigationOptions.m View File

@@ -20,6 +20,8 @@ const NSInteger TOP_BAR_TRANSPARENT_TAG = 78264803;
20 20
 -(instancetype)initWithDict:(NSDictionary *)options {
21 21
 	self = [super init];
22 22
 	self.statusBarHidden = [options objectForKey:@"statusBarHidden"];
23
+	self.statusBarBlur = [options objectForKey:@"statusBarBlur"];
24
+	self.statusBarStyle = [options objectForKey:@"statusBarStyle"];
23 25
 	self.screenBackgroundColor = [options objectForKey:@"screenBackgroundColor"];
24 26
 	self.backButtonTransition = [options objectForKey:@"backButtonTransition"];
25 27
 	self.orientation = [options objectForKey:@"orientation"];

+ 8
- 0
lib/ios/RNNRootViewController.m View File

@@ -120,6 +120,14 @@
120 120
 	return NO;
121 121
 }
122 122
 
123
+- (UIStatusBarStyle)preferredStatusBarStyle {
124
+	if (self.options.statusBarStyle && [self.options.statusBarStyle isEqualToString:@"light"]) {
125
+		return UIStatusBarStyleLightContent;
126
+	} else {
127
+		return UIStatusBarStyleDefault;
128
+	}
129
+}
130
+
123 131
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
124 132
 	return self.options.supportedOrientations;
125 133
 }