为什么我的本地手风琴无法滚动?

时间:2019-09-06 18:25:44

标签: react-native native-base

我有一个本机应用程序,并且大部分UI都使用本机库。

我在tab组件中有一个手风琴组件,并且正在使用TabNavigator。当手风琴的内容超过屏幕的高度时,当我尝试滚动到底部时,手风琴会回到顶部。

种类的一个工作步骤是强迫手风琴的高度(高度:1000),但这导致了很多空白。

这是我的代码:


      <Tabs tabBarPosition='bottom'>
        <Tab heading="Score">
          <ScrollView style={{flex: 1}}>
            <Grid>
              <Row style={{backgroundColor: '#231f20', paddingVertical: 3, paddingHorizontal: 10}}>
                  <Col>
                    <Text style={{color: '#fff', fontWeight: 'bold'}}>Header</Text>
                  </Col>
              </Row>
            </Grid>
              <Accordion
                dataArray={data}
                animation={true}
                expanded={true}
                contentContainerStyle={{flex: 1}}
                //item={{item, sport: this.state.sport, year: this.state.year, week: this.state.gameWeek}}
                renderHeader={this._renderHeader}
                renderContent={this._renderContent}

                /> 
            </ScrollView>
          </Tab>
          <Tab heading="Stakes">
            <ScrollView style={{flex: 1}}>
              <Grid>
                <Row style={{backgroundColor: '#231f20', paddingVertical: 3, paddingHorizontal: 10}}>
                    <Col>
                      <Text style={{color: '#fff', fontWeight: 'bold'}}>Header</Text>
                    </Col>
                </Row>
              </Grid>
                <Accordion
                  dataArray={data}
                  animation={true}
                  expanded={true}
                  contentContainerStyle={{flex: 1}}
                  //item={{item, sport: this.state.sport, year: this.state.year, week: this.state.gameWeek}}
                  renderHeader={this._renderHeaderStars}
                  renderContent={this._renderContentStars}

                  />
            </ScrollView>
          </Tab>
      <Tabs>

就像我说的那样,当我向下滚动时,我可以看到数据,但是随后视图又回到了开始的位置。

0 个答案:

没有答案