将默认导航标题样式改成如下即可
const TITLE_OFFSET = Platform.OS === 'ios' ? 70 : 56;
const defalutOption = {
headerStyle: {
backgroundColor: '#f2f2f2',
height:40
},
headerTintColor: '#666',
headerTitleStyle:{
alignSelf:'center',
textAlign: 'center',
flex:1,
fontSize:14
},
headerTitleContainerStyle:{
left: TITLE_OFFSET,
right: TITLE_OFFSET,
}
}
网友评论