【问题标题】:React native drawer font Color反应原生抽屉字体颜色
【发布时间】:2022-01-11 23:01:34
【问题描述】:

我的代码:

 return (
 
<Drawer.Navigator initialRouteName="HomeTabs"  

drawerContent={props => {
  return (
    <DrawerContentScrollView {...props}>
      <DrawerItemList {...props} />
      <DrawerItem activeTinTcolor = 'red' inactiveTintColor='red' label="Logout" onPress={() => props.navigation.navigate("Login")} />
    </DrawerContentScrollView>
   )
  }}
  >
<Drawer.Screen  name="HomeTabs" initialParams={{userId: userId, name: name, url: url,fullName: fullName, password: password}} component={HomeTabs} />
<Drawer.Screen name="Authors" component={AuthorsScreen} />
</Drawer.Navigator>

);
 }

在 DrawerItem 中,我可以更改文本的颜色,但是当我想在 Drawer.Screen 中这样做时,这些选项都不起作用。我尝试了选项,DrowerOptions,但它们都不起作用。

【问题讨论】:

    标签: react-native colors navigation-drawer drawerlayout react-navigation-drawer


    【解决方案1】:

    你可以像下面这样在 screenOptions 中添加它

    <Drawer.Navigator
      initialRouteName="HomeTabs"
      screenOptions={{
        headerShown: false,
        drawerActiveTintColor:"red",
        drawerInactiveTintColor:"orange"
      }}
      drawerContent={(props) => <DrawerMenu {...props} />}
    >
    </Drawer.Navigator>
    

    more options

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-30
      • 1970-01-01
      相关资源
      最近更新 更多