gpt4 book ai didi

react-native - 一起使用safeAreaView时如何去除React Native StackNavigator的内部阴影

转载 作者:行者123 更新时间:2023-12-04 13:06:46 25 4
gpt4 key购买 nike

我正在使用 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,这就是我的意思。塔克斯
enter image description here

最佳答案

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

cardStyle: { shadowColor: 'transparent' }


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

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com