1
Using React-Native and React-navigation, for some reason nothing I tried worked to centralize the title.
Attempts:
- Alignself
export default class First extends React.Component {
static navigationOptions = {
title: 'Start',
headerStyle: {
backgroundColor: '#000080',
},
headerTintColor: '#ffffff',
headerTitleStyle: {
fontWeight: 'bold',
fontSize: 20,
alignSelf: 'center',
},
}
- Textalign
export default class First extends React.Component {
static navigationOptions = {
title: 'Start',
headerStyle: {
backgroundColor: '#000080',
},
headerTintColor: '#ffffff',
headerTitleStyle: {
fontWeight: 'bold',
fontSize: 20,
textAlign: 'center',
},
}
- Both
export default class First extends React.Component {
static navigationOptions = {
title: 'Start',
headerStyle: {
backgroundColor: '#000080',
},
headerTintColor: '#ffffff',
headerTitleStyle: {
fontWeight: 'bold',
fontSize: 20,
alignSelf: 'center',
textAlign: 'center',
},
}
I also tried using empty headerRight/headerLeft, but nothing happened.