代码之家  ›  专栏  ›  技术社区  ›  HungrySoul

如何在react native中更改选项卡导航器的颜色样式?

  •  0
  • HungrySoul  · 技术社区  · 8 年前

    我是一个反应地道的新手。我正在主屏幕上使用选项卡导航器,不知道如何更改活动和非活动选项卡的颜色样式。

    export const MyApp = TabNavigator({
      Asset: {
       screen: AssetScreen
      },
     Sensors: {
      screen: sensorsStack
     },
     Settings: {
      screen: settingStack
     },
    },{
    tabBarPosition: 'bottom',
    animationEnabled: true,
    swipeEnabled:false,
    tabBarOptions: {
    upperCaseLabel: false,
    showIcon: true,
    activeBackgroundColor:'#2394C7',
    inactiveBackgroundColor:'grey',
    tabStyle:{
        marginTop:10,
        height :53,
        borderRightWidth:1
    },
    labelStyle: {
        fontSize: 15,
        fontWeight:'bold',
         marginTop: 0,
         color :'#ffffff'
      },
     },
    });
    

    1 回复  |  直到 8 年前
        1
  •  0
  •   Prasun    8 年前

    您可以使用 activeBackgroundColor 非活动背景色 下的属性 选项卡选项 设置活动和非活动选项卡的颜色。

    有关更多信息,请参阅文档 here .

    推荐文章