diff --git a/README.md b/README.md index d89d0f4..8549e3e 100644 --- a/README.md +++ b/README.md @@ -138,10 +138,11 @@ navigationBarIOS: { barTintColor: string, backgroundColor: string, translucent: boolean, + titleColor: string, } ``` -Please see the docs on [tintColor](https://developer.apple.com/documentation/uikit/uinavigationbar/1624937-tintcolor?language=objc), [barTintColor](https://developer.apple.com/documentation/uikit/uinavigationbar/1624931-bartintcolor?language=objc), [backgroundColor](https://developer.apple.com/documentation/uikit/uiview/1622591-backgroundcolor?language=objc), [translucent](https://developer.apple.com/documentation/uikit/uinavigationbar/1624928-translucent?language=objc) +Please see the docs on [tintColor](https://developer.apple.com/documentation/uikit/uinavigationbar/1624937-tintcolor?language=objc), [barTintColor](https://developer.apple.com/documentation/uikit/uinavigationbar/1624931-bartintcolor?language=objc), [backgroundColor](https://developer.apple.com/documentation/uikit/uiview/1622591-backgroundcolor?language=objc), [translucent](https://developer.apple.com/documentation/uikit/uinavigationbar/1624928-translucent?language=objc), [titleTextAttributes](https://developer.apple.com/documentation/uikit/uinavigationbar/1624953-titletextattributes?language=objc) (NSForegroundColorAttributeName) ### Exported constants diff --git a/example/EventDemo/App.js b/example/EventDemo/App.js index 94be641..e200b1c 100644 --- a/example/EventDemo/App.js +++ b/example/EventDemo/App.js @@ -67,6 +67,7 @@ export default class EventDemo extends Component { navigationBarIOS: { tintColor: 'orange', backgroundColor: 'green', + titleColor: 'blue', }, }; diff --git a/index.js b/index.js index c169d6c..77c8437 100644 --- a/index.js +++ b/index.js @@ -24,10 +24,11 @@ const processColorsIOS = config => { } const { navigationBarIOS } = config; if (navigationBarIOS) { - const { tintColor, backgroundColor, barTintColor } = navigationBarIOS; + const { tintColor, backgroundColor, barTintColor, titleColor } = navigationBarIOS; navigationBarIOS.tintColor = tintColor && processColor(tintColor); navigationBarIOS.backgroundColor = backgroundColor && processColor(backgroundColor); navigationBarIOS.barTintColor = barTintColor && processColor(barTintColor); + navigationBarIOS.titleColor = titleColor && processColor(titleColor); } return config; }; diff --git a/ios/AddCalendarEvent.m b/ios/AddCalendarEvent.m index e2286e5..296376a 100644 --- a/ios/AddCalendarEvent.m +++ b/ios/AddCalendarEvent.m @@ -210,6 +210,10 @@ -(void)assignNavbarColorsTo: (UINavigationBar *) navigationBar if (navbarOptions[@"barTintColor"]) { navigationBar.barTintColor = [RCTConvert UIColor:navbarOptions[@"barTintColor"]]; } + if(navbarOptions[@"titleColor"]) { + UIColor* titleColor = [RCTConvert UIColor:navbarOptions[@"titleColor"]]; + navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: titleColor}; + } } }