Преглед изворни кода

[V2][IOS] fixes noBorder issue with largeTitle (#4310)

* fixes noBorder issue with largeTitle

* fixes issue that change navigationbar title color to default
Mohammad Ali Jafarian пре 6 година
родитељ
комит
9c48a78bc2

+ 5
- 1
lib/ios/RNNNavigationControllerPresenter.m Прегледај датотеку

104
 		[navigationController rnn_setBackButtonColor:newOptions.topBar.backButton.color.get];
104
 		[navigationController rnn_setBackButtonColor:newOptions.topBar.backButton.color.get];
105
 	}
105
 	}
106
 	
106
 	
107
-	[navigationController rnn_setNavigationBarLargeTitleFontFamily:[newOptions.topBar.largeTitle.fontFamily getWithDefaultValue:nil] fontSize:[newOptions.topBar.largeTitle.fontSize getWithDefaultValue:nil] color:[newOptions.topBar.largeTitle.color getWithDefaultValue:nil]];
107
+
108
+	RNNLargeTitleOptions *largteTitleOptions = newOptions.topBar.largeTitle;
109
+	if (largteTitleOptions.color.hasValue || largteTitleOptions.fontSize.hasValue || largteTitleOptions.fontFamily.hasValue) {
110
+		[navigationController rnn_setNavigationBarLargeTitleFontFamily:[newOptions.topBar.largeTitle.fontFamily getWithDefaultValue:nil] fontSize:[newOptions.topBar.largeTitle.fontSize getWithDefaultValue:nil] color:[newOptions.topBar.largeTitle.color getWithDefaultValue:nil]];
111
+	}
108
 	
112
 	
109
 	[navigationController rnn_setNavigationBarFontFamily:[newOptions.topBar.title.fontFamily getWithDefaultValue:nil] fontSize:[newOptions.topBar.title.fontSize getWithDefaultValue:nil] color:[newOptions.topBar.title.color getWithDefaultValue:nil]];
113
 	[navigationController rnn_setNavigationBarFontFamily:[newOptions.topBar.title.fontFamily getWithDefaultValue:nil] fontSize:[newOptions.topBar.title.fontSize getWithDefaultValue:nil] color:[newOptions.topBar.title.color getWithDefaultValue:nil]];
110
 	
114
 	

+ 3
- 6
lib/ios/UINavigationController+RNNOptions.m Прегледај датотеку

36
 
36
 
37
 - (void)rnn_setNavigationBarNoBorder:(BOOL)noBorder {
37
 - (void)rnn_setNavigationBarNoBorder:(BOOL)noBorder {
38
 	if (noBorder) {
38
 	if (noBorder) {
39
-		self.navigationBar
40
-		.shadowImage = [[UIImage alloc] init];
41
-		[self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
39
+		[self.navigationBar setShadowImage:[[UIImage alloc] init]];
42
 	} else {
40
 	} else {
43
-		self.navigationBar
44
-		.shadowImage = nil;
41
+		[self.navigationBar setShadowImage:nil];
45
 	}
42
 	}
46
 }
43
 }
47
 
44
 
114
 	
111
 	
115
 	backItem.title = title ? title : lastViewControllerInStack.navigationItem.title;
112
 	backItem.title = title ? title : lastViewControllerInStack.navigationItem.title;
116
 	backItem.tintColor = color;
113
 	backItem.tintColor = color;
117
-
114
+	
118
 	lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
115
 	lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
119
 }
116
 }
120
 
117