【问题标题】:Remove back button from header in React Native and React Navigation从 React Native 和 React Navigation 中的标题中删除后退按钮
【发布时间】:2023-02-01 17:52:50
【问题描述】:

尝试了这两种方式,但都没有用:

options={{
  headerLeft: () => {
     return null}
}}

// method 2
screenOptions={{
   headerLeft: null,
}}

【问题讨论】:

    标签: javascript reactjs react-native react-navigation


    【解决方案1】:

    您可以对所有屏幕或其中一个屏幕执行此操作,如下所示:

    <Stack.Navigator
      // For all screens inside this Stack Navigator
      screenOptions={{
        headerBackVisible: false,
      }}
    >
      <Stack.Screen
        // For the login screen inside this Stack Navigator
        options={{ headerBackVisible: false }}
        component={LoginScreen}
        name="Login"
      />
    </Stack.Navigator>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-21
      • 1970-01-01
      • 2019-07-03
      • 2020-11-23
      • 2023-01-07
      • 2020-05-24
      • 1970-01-01
      • 2022-09-24
      相关资源
      最近更新 更多