【问题标题】:Center tab bar icons Vertically - React Native垂直居中标签栏图标 - React Native
【发布时间】:2018-10-31 13:12:29
【问题描述】:

我只是在创建自定义导航标签栏和垂直居中图标时遇到问题。看起来它被推高了一点,如下图所示:

这是标签导航的样式:

tabBarOptions: {
    activeTintColor: '#e91e63',
    labelStyle: {
        fontSize: 12,
    },
    style: {
        position: 'absolute',
        backgroundColor: 'white',
        width: DEVICE_WIDTH * 0.94,
        borderBottomLeftRadius: 33,
        borderBottomRightRadius: 33,
        borderTopLeftRadius: 10,
        borderTopRightRadius: 10,
        bottom: 12,
        marginLeft: '2.8%',
        shadowColor: '#000000',
        shadowOffset: {
          width: 0,
          height: 0.3
        },
        shadowRadius: 5,
        shadowOpacity: 0.1
    }

非常感谢!

【问题讨论】:

    标签: react-native react-navigation react-native-ios react-native-navigation


    【解决方案1】:

    可以通过为图标指定样式来解决此问题:

    <Icon
        name="user"
        color={tintColor}
        size={28}
        style={{ textAlignVertical: 'center' }}
    />
    

    【讨论】:

      猜你喜欢
      • 2012-12-28
      • 1970-01-01
      • 2013-11-16
      • 1970-01-01
      • 1970-01-01
      • 2011-08-18
      • 2019-06-04
      • 2011-04-02
      • 2021-08-01
      相关资源
      最近更新 更多