Browse Source

[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 5 years ago
parent
commit
9c48a78bc2

+ 5
- 1
lib/ios/RNNNavigationControllerPresenter.m View File

@@ -104,7 +104,11 @@
104 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 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 View File

@@ -36,12 +36,9 @@ const NSInteger BLUR_TOPBAR_TAG = 78264802;
36 36
 
37 37
 - (void)rnn_setNavigationBarNoBorder:(BOOL)noBorder {
38 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 40
 	} else {
43
-		self.navigationBar
44
-		.shadowImage = nil;
41
+		[self.navigationBar setShadowImage:nil];
45 42
 	}
46 43
 }
47 44
 
@@ -114,7 +111,7 @@ const NSInteger BLUR_TOPBAR_TAG = 78264802;
114 111
 	
115 112
 	backItem.title = title ? title : lastViewControllerInStack.navigationItem.title;
116 113
 	backItem.tintColor = color;
117
-
114
+	
118 115
 	lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
119 116
 }
120 117