Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ListView fails to scroll

Tags:

react-native

As you can see in the attached GIF, I can't scroll through the ListView. The view snaps back to the original position as soon as I release the mouse.

I've read over the documentation and it seems like scrolling should just work. Here's the implementation of render():

render: function(){
  return (
    <ListView
      automaticallyAdjustContentInsets={false}
      initialListSize={9}
      dataSource={this.state.dataSource}
      renderRow={this.renderTrack}
      renderSectionHeader={this.renderSectionHeader}/>
  );

enter image description here

like image 669
jamesfzhang Avatar asked Sep 30 '15 19:09

jamesfzhang


3 Answers

Your ListView might actually be quite small but not appear that way do to visible overflow. Try setting flex: 1 or height: 587 on your ListView's style property.

like image 98
ide Avatar answered Nov 04 '22 19:11

ide


The only time I've seen this is when contentContainerStyle is set to flex:1. Remove the flex if that's the case.

like image 22
deanmcpherson Avatar answered Nov 04 '22 20:11

deanmcpherson


setting flex:1 to list's parent did the trick for me.

like image 9
Roger Garzon Nieto Avatar answered Nov 04 '22 19:11

Roger Garzon Nieto