Skip to content

Commit 9c48a78

Browse files
mohammadalijfyogevbd
authored andcommittedFeb 4, 2019
[V2][IOS] fixes noBorder issue with largeTitle (#4310)
* fixes noBorder issue with largeTitle * fixes issue that change navigationbar title color to default
1 parent e00af9d commit 9c48a78

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed
 

‎lib/ios/RNNNavigationControllerPresenter.m

+5-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ - (void)mergeOptions:(RNNNavigationOptions *)newOptions currentOptions:(RNNNavig
104104
[navigationController rnn_setBackButtonColor:newOptions.topBar.backButton.color.get];
105105
}
106106

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+
}
108112

109113
[navigationController rnn_setNavigationBarFontFamily:[newOptions.topBar.title.fontFamily getWithDefaultValue:nil] fontSize:[newOptions.topBar.title.fontSize getWithDefaultValue:nil] color:[newOptions.topBar.title.color getWithDefaultValue:nil]];
110114

‎lib/ios/UINavigationController+RNNOptions.m

+3-6
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@ - (void)rnn_hideBarsOnScroll:(BOOL)hideOnScroll {
3636

3737
- (void)rnn_setNavigationBarNoBorder:(BOOL)noBorder {
3838
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]];
4240
} else {
43-
self.navigationBar
44-
.shadowImage = nil;
41+
[self.navigationBar setShadowImage:nil];
4542
}
4643
}
4744

@@ -114,7 +111,7 @@ - (void)rnn_setBackButtonIcon:(UIImage *)icon withColor:(UIColor *)color title:(
114111

115112
backItem.title = title ? title : lastViewControllerInStack.navigationItem.title;
116113
backItem.tintColor = color;
117-
114+
118115
lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
119116
}
120117

0 commit comments

Comments
 (0)
Please sign in to comment.