如何在同时使用safeAreaView时删除React Native StackNavigator的内部阴影

Luc*_*ira 6 shadow react-native iphone-x

我正在使用import { SafeAreaView } from 'react-native';新的iPhone X开发,但我在该区域内得到一个无聊的阴影.我该如何删除它?

图像就在这里

// Code

import { SafeAreaView } from 'react-native';

<SafeAreaView style={styles.safeArea}>
 ...
</SafeAreaView>


// Style
safeArea: {
  flex: 1,
  backgroundColor: colors.background,
},
Run Code Online (Sandbox Code Playgroud)

更新:我发现可能与StackNavigator存在某种冲突(使用headerMode:'none').当我的代码中没有safeAreaView时,堆栈会正确隐藏标题.

更新2: @Julien Malige,这就是我的观点.TKS 在此输入图像描述

Luc*_*ira 22

我使用React Navigation属性解决了这个问题:

cardStyle:{shadowColor:'transparent'}

const Routes = StackNavigator({
  Identify: { screen: IdentifyRoutes },
}, {
  headerMode: 'none',
  cardStyle: { shadowColor: 'transparent' },
});
Run Code Online (Sandbox Code Playgroud)