【发布时间】:2021-08-24 13:25:22
【问题描述】:
使用自定义样式删除 React 导航 6 中的标题 这是代码敌人堆栈导航
<NavigationContainer>
<Stack.Navigator
initialRouteName='OtpScreen'
// screenOptions={{
// headerShown: false,
// }}
screenOptions={{ headerMode: 'none' }}
>
<Stack.Screen
options={{ headerShown: false }}
name='Tabs'
component={MyTabs}
/>
</Stack.Navigator>
</NavigationContainer>
标签导航
<Tab.Navigator
useHeaderHeight={false}
screenOptions={
({
headerShown: false,
},
({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === 'Home') {
iconName = focused
? 'ios-information-circle'
: 'ios-information-circle-outline';
} else if (route.name === 'Settings') {
iconName = focused ? 'ios-list' : 'ios-list';
}
// You can return any component that you like here!
return <Ionicons name={iconName} size={size} color={color} />;
},
tabBarActiveTintColor: 'tomato',
tabBarInactiveTintColor: 'gray',
}))
}
>
我使用了所有可能的解决方案,但仍然没有得到答案,我想用我展示的自定义样式来使用它
【问题讨论】:
标签: react-native react-navigation react-native-navigation