Reputation:
React Native with Expo, fontFamily not apply to stackNavigator header title by headerTitleStyle, the font is work fine on app screens, but not apply on stackNavigator header title. any help.
Home: {screen : Home,
navigationOptions: {
headerLeft: null,
title: 'Home',
headerTitleStyle: {fontFamily: 'myFont', fontSize: 20,},
headerStyle: { marginTop: 24, },
},
},
Upvotes: 2
Views: 2082
Reputation: 273
You can use "fontWeight: undefined" inside the headerTitleStyle.
For Example :
headerTitleStyle: {
fontFamily: 'Roboto-Bold',
fontWeight:undefined,
}
Upvotes: 1
Reputation:
I found the problem, the font dose not apply on any text that takes
fontWeight: 'bold',
so you need to set fontWeight to value less than 500
fontWeight: '200',
headerTitleStyle: {fontWeight: '200', fontFamily: 'myFont', fontSize: 16,},
Upvotes: 4