移除 Drawer 导航栏的标题 - React Native

3

我正在使用抽屉导航器来创建React Native菜单,我想要移除标题栏并只保留图标栏,所以我尝试将背景颜色设置为透明,但是它没有起作用。

以下是代码:

<Drawer.Navigator      
  drawerContent={props => <DrawerContent {...props} />}>
    <Drawer.Screen
      name="Home"
      component={HomeScreen}
      options={{
        headerStyle: {
          backgroundColor: 'transparent',
        },
      }}
    />

enter image description here


现在应用于标题的样式有哪些? - Fabian S.
您是否只想要在页头左侧显示三条水平线图标? - GBourke
@Gandzal 是的,完全正确。 - Keltouma Indtaher
@FabianS。我没有为标题应用任何样式表。 - Keltouma Indtaher
2个回答

5
我通过向 Drawer.navigator 添加 screenOption 来解决了这个问题。
screenOptions={{
  headerShown: true,
  headerTransparent:true
}}

2

你好,我曾经遇到过完全相同的问题,我通过添加解决了它。

screenOptions={{
  headerShown: false
}}

到 Drawer.navigator


这应该是正确的答案。 - SeriousLee

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接