我将屏幕移动的方向更改为从左向右移动。然而,当屏幕从左向右移动时,标题标题仍然从右向左移动,这看起来当然很奇怪。有没有办法让标题也从左向右移动?
<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,
}}
/>
...
简单添加选项 headerMode: 'screen'