react-native - 屏幕位于底部 Material 选项卡栏后面

标签 react-native react-navigation

您好,我正在处理涉及底部标签栏的屏幕。为此,我已经从react-navigation-material-bottom-tabs实现了 Material 底部选项卡栏。问题是我的屏幕位于底部选项卡后面,如下所示

黄色边框是为了查看 UI 的外观而设计的。屏幕的底线预计位于底部栏的正上方,而不是其后面。

enter image description here

<SafeAreaView style={{backgroundColor: '#f3f3f5'}}>
    <View
      style={{
        borderWidth: 3,
        borderColor: 'yellow',
        width: width,
        height: height,
        flexDirection: 'column-reverse',
      }}>
      <Header data={headerData} />
      <LabelledView
        rectanglebarfunc={() => this.rectanglebarfunc()}
        height={height * 0.07}
        rectanglebarbuttontext={'List Item 01'}
        width={width}
        color="white"
        icolor="#ff007C"
        textColr="#120F3F"
        fontSize={16}
        rectanglebarfunc={() => {}}
      />
      <View
        style={{
          width: '100%',
          height: 0.5,
          backgroundColor: 'transparent',
        }}
      />
      <LabelledView
        rectanglebarfunc={() => this.rectanglebarfunc()}
        height={height * 0.07}
        rectanglebarbuttontext={'List Item 00'}
        width={width}
        color="white"
        icolor="#ff007C"
        textColr="#120F3F"
        fontSize={16}
        rectanglebarfunc={() => {}}
      />

      {/* <View
        style={{
          width: '90%',
          height: '70%',
          backgroundColor: 'red',
          alignSelf: 'center',
          marginVertical: 5,
        }}></View> */}
    </View>
  </SafeAreaView>

最佳答案

尝试将 marginBottom 添加到 safeAreaView 和 View :

<SafeAreaView style={{backgroundColor: '#f3f3f5' ,marginBottom:100}}>
    <View
      style={{
        borderWidth: 3,
        borderColor: 'yellow',
        width: width,
        height: height,
        flexDirection: 'column-reverse',
      marginBottom:100
      }}>

尝试调整你的 marginBottom 来检查 希望能帮助到你。如有疑问请放心

关于react-native - 屏幕位于底部 Material 选项卡栏后面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59948572/

相关文章:

react-native - FlatList 单选单元格

react-native - react native : How to redirect

javascript - 使用 react-navigation AppContainer 保持状态

javascript - React Native 通过 `props` 构建的导航容器传递 `createStackNavigator`

javascript - React-native Redux 组件不会在状态更改时使用 bool 值重新渲染

react-native - 无法从 React Native 中的 Material Top Bar Navigator 中删除 boxShadow

html - 使用堆栈导航的选项卡导航中的不良行为

react-native - 从 BottomTabBar 中获取 SafeAreaView 的高度

android - Bootstrap 方法返回 null - Android 在启动时立即崩溃

android - 在主屏幕上单击返回时退出应用程序