【发布时间】:2021-08-27 07:21:26
【问题描述】:
<NavigationContainer>
<Stack.Navigator screenOptions={{}}>
<Stack.Screen name="home" component={Home} />
<Stack.Screen
name="MyProfile"
component={Profile}
options={{
headerTintColor: 'white',
title: 'My Profile',
headerTransparent: true,
headerShadowVisible: false,
headerRight: () => (
<TouchableOpacity>
<DrawerIcon size={30} color={'white'} name="md-reorder-two-sharp" />
</TouchableOpacity>
),
headerLeft: () => (
<TouchableOpacity>
<Ionicons
name="arrow-back-sharp"
size={22}
color="white"
style={{ marginRight: 7, marginTop: 1, marginLeft: 3 }}
/>
</TouchableOpacity>
),
}}
/>
</Stack.Navigator>
<ModalPortal />
</NavigationContainer>
下面是我用于堆栈导航的代码,我想从那个屏幕返回
1.headerLeft: () => <TouchableOpacity>
<Ionicons name="arrow-back-sharp" size={22} color="white" style={{ marginRight: 7, marginTop: 1, marginLeft: 3 }} />
</TouchableOpacity>
}} />
【问题讨论】:
标签: javascript react-native react-native-android react-native-ios react-native-navigation