Skip to content

Commit

Permalink
[V2][IOS] fixes noBorder issue with largeTitle (#4310)
Browse files Browse the repository at this point in the history
* fixes noBorder issue with largeTitle

* fixes issue that change navigationbar title color to default
  • Loading branch information
mohammadalijf authored and yogevbd committed Feb 4, 2019
1 parent e00af9d commit 9c48a78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
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

0 comments on commit 9c48a78

Please sign in to comment.