Skip to content

Commit

Permalink
Fix largeTitle background color on iOS 13 (#6027)
Browse files Browse the repository at this point in the history
Resolves largeTitle background color from topBar.title.background.color

Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>
  • Loading branch information
yogevbd and guyca authored Mar 11, 2020
1 parent e941796 commit 979cb6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/ios/RNNComponentViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ - (instancetype)initWithLayoutInfo:(RNNLayoutInfo *)layoutInfo rootViewCreator:(
self.extendedLayoutIncludesOpaqueBars = YES;
if (@available(iOS 13.0, *)) {
self.navigationItem.standardAppearance = [UINavigationBarAppearance new];
self.navigationItem.scrollEdgeAppearance = [UINavigationBarAppearance new];
}
return self;
}
Expand Down
8 changes: 8 additions & 0 deletions lib/ios/TopBarAppearancePresenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ - (void)setTransparent:(BOOL)transparent {
- (void)updateBackgroundAppearance {
if (self.transparent) {
[self.getAppearance configureWithTransparentBackground];
[self.getScrollEdgeAppearance configureWithTransparentBackground];
} else if (self.backgroundColor) {
[self.getAppearance setBackgroundColor:self.backgroundColor];
[self.getScrollEdgeAppearance setBackgroundColor:self.backgroundColor];
} else if (self.translucent) {
[self.getAppearance configureWithDefaultBackground];
[self.getScrollEdgeAppearance configureWithDefaultBackground];
} else {
[self.getAppearance configureWithOpaqueBackground];
[self.getScrollEdgeAppearance configureWithOpaqueBackground];
}
}

Expand Down Expand Up @@ -74,4 +78,8 @@ - (UINavigationBarAppearance *)getAppearance {
return self.currentNavigationItem.standardAppearance;
}

- (UINavigationBarAppearance *)getScrollEdgeAppearance {
return self.currentNavigationItem.scrollEdgeAppearance;
}

@end

0 comments on commit 979cb6e

Please sign in to comment.