RN Listview在设置 flexDirection: 'row', flexWrap: 'wrap',后不能完全显示数据的问题

6

 

ReactNative ListView component calculates how many rows to render on initial component mount using initialListSizeproperty. By default the initialListSize is set to 10.

For reference, See the below function from ReactNative ListView source code,

  var DEFAULT_INITIAL_ROWS = 10;      
  getDefaultProps: function() {
    return {
      initialListSize: DEFAULT_INITIAL_ROWS,
      pageSize: DEFAULT_PAGE_SIZE,
      renderScrollComponent: props => ,
      scrollRenderAheadDistance: DEFAULT_SCROLL_RENDER_AHEAD,
      onEndReachedThreshold: DEFAULT_END_REACHED_THRESHOLD,
      stickyHeaderIndices: [],
    };
  }

If you want to make ListView render all items by default then you can make use of initialListSize property in ListView component like below code

 {
          return (
            
              {rowData}
            
          )
        }
      }/>

转载于:https://my.oschina.net/sfshine/blog/3067715

你可能感兴趣的:(RN Listview在设置 flexDirection: 'row', flexWrap: 'wrap',后不能完全显示数据的问题)