From 6525af140c34cf0620bbb1d957fc68caef24260e Mon Sep 17 00:00:00 2001 From: Eli Perkins Date: Fri, 3 Nov 2017 17:43:03 -0400 Subject: [PATCH 1/2] Add support for setting larget title text attributes --- ios/RCCViewController.m | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ios/RCCViewController.m b/ios/RCCViewController.m index 145be550f6e..745b99f5c17 100755 --- a/ios/RCCViewController.m +++ b/ios/RCCViewController.m @@ -378,9 +378,20 @@ -(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]; + } + if (self.navigationItem.titleView && [self.navigationItem.titleView isKindOfClass:[RCCTitleView class]]) { RCCTitleView *titleView = (RCCTitleView *)self.navigationItem.titleView; From b313392a287deaab9cf698e84d53948caaf6c3c2 Mon Sep 17 00:00:00 2001 From: Eli Perkins Date: Fri, 3 Nov 2017 17:47:37 -0400 Subject: [PATCH 2/2] Add documentation for setting large text attributes See https://developer.apple.com/documentation/uikit/uinavigationbar/2919946-largetitletextattributes --- docs/styling-the-navigator.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/styling-the-navigator.md b/docs/styling-the-navigator.md index b4fa56645f4..9e6c769af4e 100644 --- a/docs/styling-the-navigator.md +++ b/docs/styling-the-navigator.md @@ -94,7 +94,11 @@ this.props.navigator.setStyle({ navBarRightButtonFontSize: 17, // Change font size of right nav bar button 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 + // Android only navigationBarColor: '#000000', // change the background color of the bottom native navigation bar. navBarTitleTextCentered: true, // default: false. centers the title.