首页 > 解决方案 > TabNavigator 涵盖内容

问题描述

我有这个组件,其中包含一个列表,该列表由 TabNavigator 覆盖在底部。任何想法如何解决它?只有造型方式吗?

render() {
    return (
        <Container style={{ paddingBottom: 5 }}>
          <Header
            backgroundColor={'#1E6EC7'}
            placement="left"
            leftComponent={{ icon: 'menu', color: '#fff' }}
            centerComponent={{ text: 'Programul Zilei', style: { color: '#fff', fontWeight: 'bold', fontSize: 22 } }}
            rightComponent={<Icon name="ios-add" style={{ color: 'white' }} onPress={() => {
               const {students}=this.props;
               this.props.navigation.navigate('AddClass', {students})}} />}
          />
          <List>
            <FlatList
              data={this.props.classes}
              keyExtractor={(item, index) => `${index}`}
              extraData={this.state}
              renderItem={({ item }) => {
                  <ListItem
                    leftIcon={<View style={{ flexDirection: 'row' }}><Icon1 name="times" size={24} style={{ paddingRight: 10, color: 'red' }} onPress={() => {
                      this.setState({ currentStudent: wantedEmployee })
                      this.setState({ currentClass: item })
                      this.props.classDeleteModalShowUp();
                      }} />                   
                  }
            />
          </List>
        </Container>

标签: reactjsreact-nativereact-reduxreact-navigation

解决方案


您可以将特定屏幕设置 的选项卡导航器隐藏tabBarVisible为 false in navigationOptions。但我认为问题是由于标题,您可以尝试使用反应导航标题栏。否则,您可以向容器paddingBottom中添加与标题相同高度的a


推荐阅读