react-navigation 标题样式配置
2019-07-03 本文已影响0人
Melody_YM
static navigationOptions = {
title: '订单',
headerLeft: (
<TouchableOpacity onPress={abc}>
<Image source={require('./images/head_60.png')} style={{ width: 30, height: 30 }} />
</TouchableOpacity>
),
headerRight: (
<TouchableOpacity onPress={abc}>
<Image source={require('./images/head_60.png')} style={{ width: 30, height: 30 }} />
</TouchableOpacity>
),
headerTitleStyle: {
textAlign: 'center',
flex: 1
}, //兼容android手机标题文字居中
headerLeftContainerStyle: {
paddingLeft: 20
},
headerRightContainerStyle: {
paddingRight: 20
},
headerStyle: {
borderBottomWidth: 0,
elevation: 0
} //去掉下面的分割线 (兼容ios与android)
};
原文:https://blog.csdn.net/wangdanting123/article/details/89297728