美文网首页工作生活
react-navigation 标题样式配置

react-navigation 标题样式配置

作者: Melody_YM | 来源:发表于2019-07-03 23:35 被阅读0次
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

相关文章

网友评论

    本文标题:react-navigation 标题样式配置

    本文链接:https://www.haomeiwen.com/subject/cgnhhctx.html