React Navigation 6 - 标题标题移动到与屏幕相反的方向。为什么?

问题描述 投票:0回答:1

我将屏幕移动的方向更改为从左向右移动。然而,当屏幕从左向右移动时,标题标题仍然从右向左移动,这看起来当然很奇怪。有没有办法让标题也从左向右移动?

 <Stack.Screen
      name="Tabs"
      options={({navigation,route}) => ({
         headerTitleStyle: styles.headerTitleStyle,
         headerShown: false,
      })}>
          {(props) => <MyTabs {...props} />}
</Stack.Screen>
<Stack.Screen
    name="Settings"
    component={SettingsScreen}
    options={{
        headerTitle: 'Settings',
        headerTitleStyle: styles.headerTitleStyle,
        headerShown: true,
        gestureDirection: 'horizontal-inverted',
        headerLeft: () => <BackButton />
    }}
/>
</Stack.Navigator>

const Tab = createBottomTabNavigator();

...
<Tab.Screen
    name="Home"
    component={HomeScreen}
    options={{
       headerTitleStyle: styles.headerTitleStyle,
       headerShown: true,
    }}
/>
...
reactjs react-native react-native-navigation react-navigation-v6
1个回答
0
投票

简单添加选项 headerMode: 'screen'

© www.soinside.com 2019 - 2024. All rights reserved.