This is the code that I use to display a list of items returned from a JSON Api in a 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 item(s). (trims 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 of setting ListView style and contentContainerStyle to display all rows in both device orientations?