yogevbd 6 years ago
parent
commit
994ec6326b
2 changed files with 10 additions and 2 deletions
  1. 1
    0
      lib/ios/RNNStatusBarOptions.h
  2. 9
    2
      lib/ios/RNNStatusBarOptions.m

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

8
 @property (nonatomic, strong) NSNumber* hideWithTopBar;
8
 @property (nonatomic, strong) NSNumber* hideWithTopBar;
9
 @property (nonatomic, strong) NSString* style;
9
 @property (nonatomic, strong) NSString* style;
10
 @property (nonatomic, strong) NSNumber* hidden;
10
 @property (nonatomic, strong) NSNumber* hidden;
11
+@property (nonatomic, strong) NSNumber* animate;
11
 
12
 
12
 @end
13
 @end

+ 9
- 2
lib/ios/RNNStatusBarOptions.m View File

1
 #import "RNNStatusBarOptions.h"
1
 #import "RNNStatusBarOptions.h"
2
+#define kStatusBarAnimationDuration 0.35
2
 
3
 
3
 @implementation RNNStatusBarOptions
4
 @implementation RNNStatusBarOptions
4
 
5
 
19
 		}
20
 		}
20
 	}
21
 	}
21
 	
22
 	
22
-	if (self.style) {
23
-		[viewController setNeedsStatusBarAppearanceUpdate];
23
+	if (self.style || self.hidden) {
24
+		[UIView animateWithDuration:[self statusBarAnimationDuration] animations:^{
25
+			[viewController setNeedsStatusBarAppearanceUpdate];
26
+		}];
24
 	}
27
 	}
25
 }
28
 }
26
 
29
 
30
+- (CGFloat)statusBarAnimationDuration {
31
+	return [self.animate boolValue] ? kStatusBarAnimationDuration : CGFLOAT_MIN;
32
+}
33
+
27
 @end
34
 @end