如何从React-Navigation的导航栏中删除SafeAreaView?

问题描述 投票:0回答:1

我必须对底部导航栏进行非常定制的设计。我在屏幕上使用ImageBackground,并且需要导航栏在其上方而不是下方进行绘制。

我想问题是在幕后使用的SafeAreaView。如何删除?

编辑:我在Android上工作,我只是发现SafeAreaView仅在iOS上工作。所以也许我需要一种不同的方式来实现我的目标?

react-native flexbox react-navigation
1个回答
0
投票

也许您使用了错误的SafeAreaView,因为您知道来自react-navigation的SafeAreaView使得React native具有SafeAreaView

import { SafeAreaView } from 'react-navigation';

然后您可以使用prop forceInset来自定义填充,具体取决于您的情况,

或替代项

<SafeAreaView forceInset={{ top: 'always' }} style={{ backgroundColor: '#212121', flex: 1}}>
  <View>
        <Text>SafeAreaView - Implementation</Text>
  </View>

关于react-navigation SafeAreaView的更多信息

也在这里还有react-navigation SafeAreaView

© www.soinside.com 2019 - 2024. All rights reserved.