React原生纸张-底部导航

s6fujrry  于 2023-02-25  发布在  React
关注(0)|答案(2)|浏览(135)

有谁知道我怎样才能改变我标记的紫色吗?
我用的是最新版的React纸。
谢谢!

z4bn682m

z4bn682m1#

你试过给你的论文添加主题吗?看下面的例子。

const theme = {
  ...DefaultTheme,
  roundness: 2,
  version: 3,
  colors: {
    ...DefaultTheme.colors,
    primary: '#3498db',
    secondary: '#f1c40f',
    tertiary: '#a1b2c3'
  },
};

 <PaperProvider theme={theme}>
      <App />
    </PaperProvider>

请注意,这不是我的代码,而是来自文档。请参见此链接中涉及的文档:https://callstack.github.io/react-native-paper/theming.html

oxf4rvwz

oxf4rvwz2#

我已经设置为透明,因为我不希望任何颜色,而不是紫色。你可以设置任何所需的颜色代码,而不是透明。

<BottomNavigation
        navigationState={{index, routes}}
        activeColor={theme.colors.primary}
        inactiveColor="#d3d3d3"
        barStyle={{backgroundColor: '#F5F5F5'}}
        theme={{colors: {secondaryContainer: 'transparent'}}}
        onIndexChange={setIndex}
        renderScene={renderScene}
      />

相关问题