headerStyle 的这个实现有什么问题?我想隐藏 header 的 shadow/elevation
What's wrong with this implementation for headerStyle? I want to hide the shadow/elevation of the header
https://drive.google.com/file/d/1456izDo_zxkFxqAti7Kd4Reaer5mwzOh/view?usp=sharing
我想隐藏 header 的影子,但做不到。我尝试使用 navigationOptions 但找不到隐藏 header 阴影的方法。 backgroundColor 工作正常但阴影不是。请指出错误。谢谢。
const Stack = createNativeStackNavigator();
<Stack.Navigator
defaultNavigationOptions={{}}
screenOptions={({navigation}) => ({
headerBackTitleVisible: false,
title: '',
headerStyle: {
backgroundColor: 'papayawhip',
elevation: 0,
shadowOpacity: 0,
borderBottomWidth: 0,
},
headerLeft: () => (
<AppMaterialIcon
onPress={() => navigation.goBack()}
name={'chevron-left'}
style={{marginLeft: -10}}
size={35}
color={colors.kermitGreen}
backgroundColor={colors.white}
/>
),
})}>
<Stack.Screen
name="ForgotPasswordEmail"
component={ForgotPasswordEmailScreen}
/>
</Stack.Navigator>
我刚刚做的是设置 headerShadowVisible: false。成功了!!
https://drive.google.com/file/d/1456izDo_zxkFxqAti7Kd4Reaer5mwzOh/view?usp=sharing
我想隐藏 header 的影子,但做不到。我尝试使用 navigationOptions 但找不到隐藏 header 阴影的方法。 backgroundColor 工作正常但阴影不是。请指出错误。谢谢。
const Stack = createNativeStackNavigator();
<Stack.Navigator
defaultNavigationOptions={{}}
screenOptions={({navigation}) => ({
headerBackTitleVisible: false,
title: '',
headerStyle: {
backgroundColor: 'papayawhip',
elevation: 0,
shadowOpacity: 0,
borderBottomWidth: 0,
},
headerLeft: () => (
<AppMaterialIcon
onPress={() => navigation.goBack()}
name={'chevron-left'}
style={{marginLeft: -10}}
size={35}
color={colors.kermitGreen}
backgroundColor={colors.white}
/>
),
})}>
<Stack.Screen
name="ForgotPasswordEmail"
component={ForgotPasswordEmailScreen}
/>
</Stack.Navigator>
我刚刚做的是设置 headerShadowVisible: false。成功了!!