【发布时间】:2023-02-07 04:50:48
【问题描述】:
我正在使用 react-navigation 用于导航目的的 react-native 中的应用程序。 当我在这里偶然发现一个问题时,我正在学习使用 react-navigation 中的导航抽屉。 每当我点击/长按抽屉项目时,项目的背景首先变为灰色,然后变为 activeColor(我已经在选项中定义)。 灰色看起来很糟糕。 如何删除或更改它?
这是我尝试通过单击“通知”项从“主页”切换到“通知”的时候。
我正在分享以下代码:
<Drawer.Navigator
screenOptions={{
headerPressColor: Colors['blue'],
headerShadowVisible: true,
drawerActiveBackgroundColor: Colors['primary'],
drawerActiveTintColor: '#fff',
drawerInactiveTintColor: '#333',
drawerLabelStyle: {
marginLeft: -20,
fontFamily: 'Poppins-Regular',
fontSize: 15,
},
itemStyle: { flex: 1, marginVertical: 5 },
}}
// Here we are setting our custom sidebar menu
drawerContent={(props) => <CustomSidebarMenu {...props} />}
>
【问题讨论】:
标签: android react-native react-navigation react-navigation-drawer