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时,堆栈会正确隐藏标题.
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)
| 归档时间: |
|
| 查看次数: |
2419 次 |
| 最近记录: |