This is the code that I use to display a list of items returned from Api JSON in ListView.
render(){ var listHeight = this.state.itemCount ? ((this.state.itemCount) * 115 ) : 0; var itemsHeight = 460; itemsListView = (<ListView bounces={true} style={{height: itemsHeight}} contentContainerStyle={{height: listHeight}} dataSource={this.state.dataSource} renderRow={this.renderRow.bind(this)} automaticallyAdjustContentInsets={false} initialListSize={4} />); }
However, the ListView component will not allow me to view the last one or two items (s). (crop more content when the device is in landscape orientation)
The renderRow method returns rows of height 115, as shown below:
return ( <TouchableHighlight onPress={() => this.rowPressed(rowData)} style={{height: 115}}>...</TouchableHighlight>
What is the correct way to set the ListView and contentContainerStyle style to display all rows in both device orientations?
source share