Reputation: 107
I'm new to react native. i'm working on navigation. the problem is in header text is not getting in center. i have try this
static navigationOptions = {
title: "Help",
alignSelf: 'center',
marginLeft: 50,
headerLayoutPreset: 'center',
textAlign: 'center',
justifyContent:"center",
headerStyle: {
backgroundColor: '#a01b1b',
textAlign: 'center',
headerLayoutPreset: 'center',
justifyContent:"center",
},
Upvotes: 0
Views: 298
Reputation: 3295
Set headerTitleStyle
like below to set your title in the center of the header
navigationOptions: {
title: 'Help',
headerTitleStyle: {
flex: 1,
textAlign: 'center',
fontFamily:'Lato-Black' //for setting font
},
headerStyle: {
backgroundColor: '#a01b1b', //set style to set backgroundColor to full header
},
headerBackTitle: 'Login',
headerRight: <View/> //If you have back arrow at headerLeft otherwise remove this line
}
Upvotes: 2