Browse Source

Fix topBar.background.component render behind title (#5144)

Yogev Ben David 5 years ago
parent
commit
8d2165f37b
No account linked to committer's email address

+ 2
- 0
lib/ios/RNNBasePresenter.h View File

12
 
12
 
13
 - (void)applyOptionsOnInit:(RNNNavigationOptions *)initialOptions;
13
 - (void)applyOptionsOnInit:(RNNNavigationOptions *)initialOptions;
14
 
14
 
15
+- (void)applyOptionsOnViewDidLayoutSubviews:(RNNNavigationOptions *)options;
16
+
15
 - (void)applyOptions:(RNNNavigationOptions *)options;
17
 - (void)applyOptions:(RNNNavigationOptions *)options;
16
 
18
 
17
 - (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options;
19
 - (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options;

+ 4
- 0
lib/ios/RNNBasePresenter.m View File

19
 	
19
 	
20
 }
20
 }
21
 
21
 
22
+- (void)applyOptionsOnViewDidLayoutSubviews:(RNNNavigationOptions *)options {
23
+	
24
+}
25
+
22
 - (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options {
26
 - (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options {
23
 	UIViewController* viewController = self.bindedViewController;
27
 	UIViewController* viewController = self.bindedViewController;
24
 	
28
 	

+ 4
- 0
lib/ios/RNNNavigationController.m View File

12
 
12
 
13
 @implementation RNNNavigationController
13
 @implementation RNNNavigationController
14
 
14
 
15
+- (void)viewDidLayoutSubviews {
16
+	[super viewDidLayoutSubviews];
17
+	[self.presenter applyOptionsOnViewDidLayoutSubviews:self.resolveOptions];
18
+}
15
 
19
 
16
 - (UIViewController *)getCurrentChild {
20
 - (UIViewController *)getCurrentChild {
17
 	return self.topViewController;
21
 	return self.topViewController;

+ 6
- 4
lib/ios/RNNNavigationControllerPresenter.m View File

47
 	[navigationController rnn_setNavigationBarFontFamily:[options.topBar.title.fontFamily getWithDefaultValue:nil] fontSize:[options.topBar.title.fontSize getWithDefaultValue:nil] color:[options.topBar.title.color getWithDefaultValue:nil]];
47
 	[navigationController rnn_setNavigationBarFontFamily:[options.topBar.title.fontFamily getWithDefaultValue:nil] fontSize:[options.topBar.title.fontSize getWithDefaultValue:nil] color:[options.topBar.title.color getWithDefaultValue:nil]];
48
 	[navigationController rnn_setBackButtonColor:[options.topBar.backButton.color getWithDefaultValue:nil]];
48
 	[navigationController rnn_setBackButtonColor:[options.topBar.backButton.color getWithDefaultValue:nil]];
49
 	[navigationController rnn_setBackButtonIcon:[options.topBar.backButton.icon getWithDefaultValue:nil] withColor:[options.topBar.backButton.color getWithDefaultValue:nil] title:[options.topBar.backButton.showTitle getWithDefaultValue:YES] ? [options.topBar.backButton.title getWithDefaultValue:nil] : @""];
49
 	[navigationController rnn_setBackButtonIcon:[options.topBar.backButton.icon getWithDefaultValue:nil] withColor:[options.topBar.backButton.color getWithDefaultValue:nil] title:[options.topBar.backButton.showTitle getWithDefaultValue:YES] ? [options.topBar.backButton.title getWithDefaultValue:nil] : @""];
50
-	
51
-	if (options.topBar.background.component.name.hasValue) {
52
-		[self presentBackgroundComponent];
53
-	}
54
 }
50
 }
55
 
51
 
56
 - (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options {
52
 - (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options {
60
 	[navigationController rnn_setBackButtonIcon:[options.topBar.backButton.icon getWithDefaultValue:nil] withColor:[options.topBar.backButton.color getWithDefaultValue:nil] title:[options.topBar.backButton.showTitle getWithDefaultValue:YES] ? [options.topBar.backButton.title getWithDefaultValue:nil] : @""];
56
 	[navigationController rnn_setBackButtonIcon:[options.topBar.backButton.icon getWithDefaultValue:nil] withColor:[options.topBar.backButton.color getWithDefaultValue:nil] title:[options.topBar.backButton.showTitle getWithDefaultValue:YES] ? [options.topBar.backButton.title getWithDefaultValue:nil] : @""];
61
 }
57
 }
62
 
58
 
59
+- (void)applyOptionsOnViewDidLayoutSubviews:(RNNNavigationOptions *)options {
60
+	if (options.topBar.background.component.name.hasValue) {
61
+		[self presentBackgroundComponent];
62
+	}
63
+}
64
+
63
 - (void)applyOptionsBeforePopping:(RNNNavigationOptions *)options {
65
 - (void)applyOptionsBeforePopping:(RNNNavigationOptions *)options {
64
 	RNNNavigationController* navigationController = self.bindedViewController;
66
 	RNNNavigationController* navigationController = self.bindedViewController;
65
 	[navigationController setTopBarBackgroundColor:[options.topBar.background.color getWithDefaultValue:nil]];
67
 	[navigationController setTopBarBackgroundColor:[options.topBar.background.color getWithDefaultValue:nil]];