【问题标题】:bottom-tabs background color in react native app反应本机应用程序中的底部标签背景颜色
【发布时间】:2021-09-06 20:35:10
【问题描述】:

我在我的 expo 应用程序中使用 react-navigation 和底部选项卡。
我已经指定了一些类似的选项:

  <TabStack.Navigator
      initialRouteName="Compte"
      tabBarOptions={{
        activeTintColor: EAppColors.PRIMARY_GREEN,
        labelStyle: {
          fontFamily: 'BeVietnam-Regular',
          fontSize: normalize(12),
          fontStyle: 'normal',
          lineHeight: 20,
          textAlign: 'center',
          marginBottom: 5,
        },
        tabStyle: {
          alignItems: 'center',
          justifyContent: 'center',
          height: 40,
          marginTop: '3.5%',
        },
        style: { paddingHorizontal: '5%' },
      }}>  

我需要在标签栏的左侧和右侧放置一些顶部半径,但后面的视图保持其颜色 ....

如何更改后面视图的颜色? (图片左上角灰色)

【问题讨论】:

    标签: react-native expo react-navigation tabbar


    【解决方案1】:

    用View 包裹你的&lt;TabStack.Navigator&gt;&lt;/TabStack.Navigator&gt; 和一些backgroundColor

    类似的东西

    <View style={{ flex:1, backgroundColor: 'red' }}> // Or whatever color you want
      <TabStack.Navigator>
          // All TabScreens etc.. here
      </TabStack.Navigator>
    </View>
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-10-12
    • 1970-01-01
    • 2023-02-03
    • 2021-01-13
    • 1970-01-01
    • 2019-02-10
    • 2023-01-31
    • 1970-01-01
    相关资源
    最近更新 更多