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
 	
15
 	
16
 	if (self.visible) {
16
 	if (self.visible) {
17
 		[((RNNTabBarController *)viewController.tabBarController) setTabBarHidden:![self.visible boolValue] animated:[self.animate boolValue]];
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
 	if (self.testID) {
22
 	if (self.testID) {
31
 	
33
 	
32
 	if (self.backgroundColor) {
34
 	if (self.backgroundColor) {
33
 		viewController.tabBarController.tabBar.barTintColor = [RCTConvert UIColor:self.backgroundColor];
35
 		viewController.tabBarController.tabBar.barTintColor = [RCTConvert UIColor:self.backgroundColor];
36
+	} else {
37
+		viewController.tabBarController.tabBar.barTintColor = nil;
34
 	}
38
 	}
35
 	
39
 	
36
 	if (self.translucent) {
40
 	if (self.translucent) {
37
 		viewController.tabBarController.tabBar.translucent = [self.translucent boolValue];
41
 		viewController.tabBarController.tabBar.translucent = [self.translucent boolValue];
42
+	} else {
43
+		viewController.tabBarController.tabBar.translucent = YES;
38
 	}
44
 	}
39
 	
45
 	
40
 	if (self.hideShadow) {
46
 	if (self.hideShadow) {

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

51
 	}
51
 	}
52
 }
52
 }
53
 
53
 
54
--(void)applyOn:(UIViewController*)viewController {
55
-//	[_defaultOptions applyOn:viewController];
56
-	
54
+-(void)applyOn:(UIViewController*)viewController {	
57
 	[self.topBar applyOn:viewController];
55
 	[self.topBar applyOn:viewController];
58
 	[self.bottomTabs applyOn:viewController];
56
 	[self.bottomTabs applyOn:viewController];
59
 	[self.topTab applyOn:viewController];
57
 	[self.topTab applyOn:viewController];

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

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