yogevbd преди 6 години
родител
ревизия
994ec6326b
променени са 2 файла, в които са добавени 10 реда и са изтрити 2 реда
  1. 1
    0
      lib/ios/RNNStatusBarOptions.h
  2. 9
    2
      lib/ios/RNNStatusBarOptions.m

+ 1
- 0
lib/ios/RNNStatusBarOptions.h Целия файл

@@ -8,5 +8,6 @@ extern const NSInteger BLUR_STATUS_TAG;
8 8
 @property (nonatomic, strong) NSNumber* hideWithTopBar;
9 9
 @property (nonatomic, strong) NSString* style;
10 10
 @property (nonatomic, strong) NSNumber* hidden;
11
+@property (nonatomic, strong) NSNumber* animate;
11 12
 
12 13
 @end

+ 9
- 2
lib/ios/RNNStatusBarOptions.m Целия файл

@@ -1,4 +1,5 @@
1 1
 #import "RNNStatusBarOptions.h"
2
+#define kStatusBarAnimationDuration 0.35
2 3
 
3 4
 @implementation RNNStatusBarOptions
4 5
 
@@ -19,9 +20,15 @@
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 34
 @end