我正在使用import { SafeAreaView } from 'react-native';进行新的iPhone X开发,但是在该区域内部却出现了无聊的阴影。我该如何删除?

The image is here

// Code

import { SafeAreaView } from 'react-native';

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


// Style
safeArea: {
  flex: 1,
  backgroundColor: colors.background,
},

更新:我发现与StackNavigator(headerMode:“none”)可能存在某种冲突。当我的代码中没有safeAreaView时,可正确隐藏标题。

更新2: @Julien Malige,这就是我的意思。 ks
react-native - 一起使用safeAreaView时如何删除React Native StackNavigator的内部阴影-LMLPHP

最佳答案

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


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

关于react-native - 一起使用safeAreaView时如何删除React Native StackNavigator的内部阴影,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/48361898/

10-09 16:45