Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/styling-the-navigator.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ this.props.navigator.setStyle({
navBarRightButtonColor: 'blue', // Change color of right nav bar button
navBarRightButtonFontWeight: '600', // Change font weight of right nav bar button

navBarLargeTextColor: '#000000', // change the text color of large titles
navBarLargeTextFontSize: 34, // change the font size of large titles
navBarLargeTextFontFamily: 'font-name', // Changes the large title font

topBarShadowColor: 'blue' // Sets shadow of the navbar, Works only when topBarElevationShadowEnabled: true
topBarShadowOpacity: 0.5, // Sets shadow opacity on the navbar, Works only when topBarElevationShadowEnabled: true
topBarShadowOffset: 12, // Sets shadow offset on the navbar, Works only when topBarElevationShadowEnabled: true
Expand Down
13 changes: 12 additions & 1 deletion ios/RCCViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,19 @@ -(void)setStyleOnAppearForViewController:(UIViewController*)viewController appea
viewController.navigationController.navigationBar.barTintColor = nil;
}

NSMutableDictionary *titleTextAttributes = [RCTHelpers textAttributesFromDictionary:self.navigatorStyle withPrefix:@"navBarText" baseFont:[UIFont boldSystemFontOfSize:17]];
NSMutableDictionary *titleTextAttributes = [RCTHelpers textAttributesFromDictionary:self.navigatorStyle
withPrefix:@"navBarText"
baseFont:[UIFont boldSystemFontOfSize:17]];
[self.navigationController.navigationBar setTitleTextAttributes:titleTextAttributes];

if ([self.navigationController.navigationBar respondsToSelector:@selector(setLargeTitleTextAttributes:)]) {
// As defined in Apple's UI Design Resources: https://developer.apple.com/design/resources/
UIFont *largeBaseFont = [UIFont boldSystemFontOfSize:34];
NSMutableDictionary *largeTitleTextAttributes = [RCTHelpers textAttributesFromDictionary:self.navigatorStyle
withPrefix:@"navBarLargeText"
baseFont:largeBaseFont];
[self.navigationController.navigationBar setLargeTitleTextAttributes:largeTitleTextAttributes];
}

NSMutableDictionary *navButtonTextAttributes = [RCTHelpers textAttributesFromDictionary:self.navigatorStyle withPrefix:@"navBarButton"];
NSMutableDictionary *leftNavButtonTextAttributes = [RCTHelpers textAttributesFromDictionary:self.navigatorStyle withPrefix:@"navBarLeftButton"];
Expand Down