Browse Source

styles should not persist in stack

yogevbd 6 years ago
parent
commit
a0d7d933c5
3 changed files with 16 additions and 7 deletions
  1. 6
    0
      lib/ios/RNNBottomTabsOptions.m
  2. 1
    3
      lib/ios/RNNNavigationOptions.m
  3. 9
    4
      lib/ios/RNNTopBarOptions.m

+ 6
- 0
lib/ios/RNNBottomTabsOptions.m View File

@@ -15,6 +15,8 @@ extern const NSInteger BLUR_TOPBAR_TAG;
15 15
 	
16 16
 	if (self.visible) {
17 17
 		[((RNNTabBarController *)viewController.tabBarController) setTabBarHidden:![self.visible boolValue] animated:[self.animate boolValue]];
18
+	} else {
19
+		[((RNNTabBarController *)viewController.tabBarController) setTabBarHidden:NO animated:NO];
18 20
 	}
19 21
 	
20 22
 	if (self.testID) {
@@ -31,10 +33,14 @@ extern const NSInteger BLUR_TOPBAR_TAG;
31 33
 	
32 34
 	if (self.backgroundColor) {
33 35
 		viewController.tabBarController.tabBar.barTintColor = [RCTConvert UIColor:self.backgroundColor];
36
+	} else {
37
+		viewController.tabBarController.tabBar.barTintColor = nil;
34 38
 	}
35 39
 	
36 40
 	if (self.translucent) {
37 41
 		viewController.tabBarController.tabBar.translucent = [self.translucent boolValue];
42
+	} else {
43
+		viewController.tabBarController.tabBar.translucent = YES;
38 44
 	}
39 45
 	
40 46
 	if (self.hideShadow) {

+ 1
- 3
lib/ios/RNNNavigationOptions.m View File

@@ -51,9 +51,7 @@ const NSInteger TOP_BAR_TRANSPARENT_TAG = 78264803;
51 51
 	}
52 52
 }
53 53
 
54
--(void)applyOn:(UIViewController*)viewController {
55
-//	[_defaultOptions applyOn:viewController];
56
-	
54
+-(void)applyOn:(UIViewController*)viewController {	
57 55
 	[self.topBar applyOn:viewController];
58 56
 	[self.bottomTabs applyOn:viewController];
59 57
 	[self.topTab applyOn:viewController];

+ 9
- 4
lib/ios/RNNTopBarOptions.m View File

@@ -16,6 +16,7 @@ extern const NSInteger BLUR_TOPBAR_TAG;
16 16
 - (instancetype)initWithDict:(NSDictionary *)dict {
17 17
 	self = [super initWithDict:dict];
18 18
 	self.title = [RNNTitleOptions new];
19
+
19 20
 	return self;
20 21
 }
21 22
 
@@ -42,16 +43,16 @@ extern const NSInteger BLUR_TOPBAR_TAG;
42 43
 		}
43 44
 	}
44 45
 	
45
-	
46
-	
47
-	
48
-	
49 46
 	if (self.visible) {
50 47
 		[viewController.navigationController setNavigationBarHidden:![self.visible boolValue] animated:[self.animate boolValue]];
48
+	} else {
49
+		[viewController.navigationController setNavigationBarHidden:NO animated:NO];
51 50
 	}
52 51
 	
53 52
 	if (self.hideOnScroll) {
54 53
 		viewController.navigationController.hidesBarsOnSwipe = [self.hideOnScroll boolValue];
54
+	} else {
55
+		viewController.navigationController.hidesBarsOnSwipe = NO;
55 56
 	}
56 57
 	
57 58
 	if (self.buttonColor) {
@@ -112,6 +113,8 @@ extern const NSInteger BLUR_TOPBAR_TAG;
112 113
 	
113 114
 	if (self.translucent) {
114 115
 		viewController.navigationController.navigationBar.translucent = [self.translucent boolValue];
116
+	} else {
117
+		viewController.navigationController.navigationBar.translucent = YES;
115 118
 	}
116 119
 	
117 120
 	if (self.drawBehind) {
@@ -120,6 +123,8 @@ extern const NSInteger BLUR_TOPBAR_TAG;
120 123
 		} else {
121 124
 			viewController.edgesForExtendedLayout &= ~UIRectEdgeTop;
122 125
 		}
126
+	} else {
127
+		viewController.edgesForExtendedLayout = UIRectEdgeAll;
123 128
 	}
124 129
 	
125 130
 	if (self.noBorder) {