Reputation: 89
I tried to hide the header shadow using the elevation 0 attribute.
On Android 10, it doesn't work. The header is gray. In other versions, it works.
I'm using React Navigation V5.
Android 10 with elevation 0:
Android 10 without elevation 0:
My code:
<Stack.Navigator>
<Stack.Screen
name="DiscountsReleaseDetail"
component={DiscountsReleaseDetail}
options={({ navigation, route }) => {
const { numSeq, codMaquina } = route.params.order;
return {
headerTitle: `Pedido ${numSeq}/${codMaquina}`,
headerTitleAlign: 'center',
headerBackTitleVisible: false,
headerTintColor: '#fff',
headerStyle: {
backgroundColor: colorCompany,
shadowOpacity: 0, // remove shadow on iOS
elevation: 0, // remove shadow on Android
},
headerLeft: () => (
<HeaderButtonBack
onPress={() => {
navigation.reset({
index: 0,
routes: [{ name: 'DiscountsRelease' }],
});
}}
/>
),
};
}}
/>
</Stack.Navigator>
Upvotes: 2
Views: 1551
Reputation: 141
try this setting. worked for me.
headerStyle: {
backgroundColor: "black",
shadowOpacity: 0,
shadowOffset: {
height: 0,
},
shadowRadius: 0,
elevation: 0}
Upvotes: 6