我想要實現的無限滾動,所以我做這在我的ListView標籤陣營本地的ListView onEndReached不叫
renderRow(data){
return (
<CardSection>
<Text>
{data.id}
</Text>
</CardSection>
);
}
<ListView
dataSource={this.dataSource}
renderRow={this.renderRow}
onEndReached = {this.loadMoreNews.bind(this)}
pageSize = {5}
/>
我得到5個數據取每次我在loadMoreNews()和componentWillMount呼叫行動。因爲前5個數據不能填滿整個屏幕,我預計onEndReached會自動調用,因爲它已經在ListView的末尾,但它不會。
我試圖在renderRow文本標籤的風格融入這個
renderRow(data){
return (
<CardSection>
<Text style={{height:100}}>
{data.id}
</Text>
</CardSection>
);
}
和它的作品,因爲我想要的。恐怕如果我的應用程序在寬屏設備上運行,我的renderRow將不會填滿整個屏幕。
這是ListView的行爲還是我錯過了什麼?解決辦法是什麼?我真的不想強迫我的組件變得非常大,所以它總是填滿整個屏幕。