Refresh Controll stops working if listview exits the screen

Asked

Viewed 72 times

1

I’m trying to get a list of Firebase items, including images, that will be rendered in a Listview.

But the problem is that when Listview gets bigger than the screen, then Refreshcontrol no longer works.

Working, with a full list "inside" the screen

Not working, if pulled appears this effect of "limit"


Render method

   <View contentContainerStyle={{ flex: 1 }}>
    <ListView
      enableEmptySections
      dataSource={this.dataSource}
      renderRow={this.renderRow}
      refreshControl={
        <RefreshControl
          refreshing={this.state.refreshing}
          onRefresh={this.onRefresh.bind(this)}
        />
      }
    />
  </View>

  onRefresh() {
    this.setState({ refreshing: true });
    this.props.eventsFetch();
  }

I even tried using FlatList but it won’t even be like that.

  • in this video the guy uses Refresh in a Listview, see if you can do something similar: https://www.youtube.com/watch?v=ScaXi00HRg0

  • tried to put a style={{flex:1}} in his ListView?

  • Another detail contentContainerStyle is a prop of ListView therefore this proposal in View will have no effect.

  • I tried to put style={{ flex: 1 }} in my ListView but it didn’t help. I tried to take the contentContainerStyle and put in the ListView also, it didn’t work

  • Have you tried using the ScrollView in place?

  • Already, and of the same problem, I managed using a snapshot of firebase, when there is change, shows a button to do the refresh

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.