diff --git a/docs/styling-the-navigator.md b/docs/styling-the-navigator.md index cdf3959bfd3..0c5c9ec4636 100644 --- a/docs/styling-the-navigator.md +++ b/docs/styling-the-navigator.md @@ -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 diff --git a/ios/RCCViewController.m b/ios/RCCViewController.m index 2086b2d76bd..fa0c2850d54 100755 --- a/ios/RCCViewController.m +++ b/ios/RCCViewController.m @@ -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"];