【发布时间】:2020-10-01 14:12:16
【问题描述】:
我尝试使用海拔 0 属性隐藏标题阴影。
在 Android 10 上,它不起作用。标题是灰色的。 在其他版本中,它可以工作。
我正在使用 React Navigation V5。
高度为 0 的 Android 10:
我的代码:
<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>
【问题讨论】:
-
可能是 lib 本身的问题,建议在 GitHub repo 中开一个新的 issue
标签: react-native react-navigation