Selaa lähdekoodia

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

Yogev Ben David 5 vuotta sitten
vanhempi
commit
8d2165f37b
No account linked to committer's email address

+ 2
- 0
lib/ios/RNNBasePresenter.h Näytä tiedosto

@@ -12,6 +12,8 @@ typedef void (^RNNReactViewReadyCompletionBlock)(void);
12 12
 
13 13
 - (void)applyOptionsOnInit:(RNNNavigationOptions *)initialOptions;
14 14
 
15
+- (void)applyOptionsOnViewDidLayoutSubviews:(RNNNavigationOptions *)options;
16
+
15 17
 - (void)applyOptions:(RNNNavigationOptions *)options;
16 18
 
17 19
 - (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options;

+ 4
- 0
lib/ios/RNNBasePresenter.m Näytä tiedosto

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

+ 4
- 0
lib/ios/RNNNavigationController.m Näytä tiedosto

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

+ 6
- 4
lib/ios/RNNNavigationControllerPresenter.m Näytä tiedosto

@@ -47,10 +47,6 @@
47 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 48
 	[navigationController rnn_setBackButtonColor:[options.topBar.backButton.color getWithDefaultValue:nil]];
49 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 52
 - (void)applyOptionsOnWillMoveToParentViewController:(RNNNavigationOptions *)options {
@@ -60,6 +56,12 @@
60 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 65
 - (void)applyOptionsBeforePopping:(RNNNavigationOptions *)options {
64 66
 	RNNNavigationController* navigationController = self.bindedViewController;
65 67
 	[navigationController setTopBarBackgroundColor:[options.topBar.background.color getWithDefaultValue:nil]];