Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 10 commits into from
Feb 4, 2019
6 changes: 5 additions & 1 deletion lib/ios/RNNNavigationControllerPresenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ - (void)mergeOptions:(RNNNavigationOptions *)newOptions currentOptions:(RNNNavig
[navigationController rnn_setBackButtonColor:newOptions.topBar.backButton.color.get];
}

[navigationController rnn_setNavigationBarLargeTitleFontFamily:[newOptions.topBar.largeTitle.fontFamily getWithDefaultValue:nil] fontSize:[newOptions.topBar.largeTitle.fontSize getWithDefaultValue:nil] color:[newOptions.topBar.largeTitle.color getWithDefaultValue:nil]];

RNNLargeTitleOptions *largteTitleOptions = newOptions.topBar.largeTitle;
if (largteTitleOptions.color.hasValue || largteTitleOptions.fontSize.hasValue || largteTitleOptions.fontFamily.hasValue) {
[navigationController rnn_setNavigationBarLargeTitleFontFamily:[newOptions.topBar.largeTitle.fontFamily getWithDefaultValue:nil] fontSize:[newOptions.topBar.largeTitle.fontSize getWithDefaultValue:nil] color:[newOptions.topBar.largeTitle.color getWithDefaultValue:nil]];
}

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

Expand Down
9 changes: 3 additions & 6 deletions lib/ios/UINavigationController+RNNOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@ - (void)rnn_hideBarsOnScroll:(BOOL)hideOnScroll {

- (void)rnn_setNavigationBarNoBorder:(BOOL)noBorder {
if (noBorder) {
self.navigationBar
.shadowImage = [[UIImage alloc] init];
[self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
[self.navigationBar setShadowImage:[[UIImage alloc] init]];
} else {
self.navigationBar
.shadowImage = nil;
[self.navigationBar setShadowImage:nil];
}
}

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

backItem.title = title ? title : lastViewControllerInStack.navigationItem.title;
backItem.tintColor = color;

lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
}

Expand Down