Android 如何知道ListView是否已完成渲染?
假设我有以下代码块:Android 如何知道ListView是否已完成渲染?,android,reactjs,react-native,Android,Reactjs,React Native,假设我有以下代码块: componentWillMount() { fetch('API_LINK', { method: "GET" }) .then((data) => data.json()) .then((data) => this.setState(datasource: ds.cloneWithRows(data))) .done() } _renderRow(rowID){
componentWillMount() {
fetch('API_LINK', {
method: "GET"
})
.then((data) => data.json())
.then((data) => this.setState(datasource: ds.cloneWithRows(data)))
.done()
}
_renderRow(rowID){
return(
<Text>{rowID.title}</Text>
)
}
render() {
return(
//....
)
}
componentWillMount(){
获取('API_链接'{
方法:“获取”
})
.then((data)=>data.json())
.then((数据)=>this.setState(数据源:ds.cloneWithRows(数据)))
.完成
}
_renderRow(rowID){
返回(
{rowID.title}
)
}
render(){
返回(
//....
)
}
是否有某种事件可以帮助我确切地知道ListView数据何时完成渲染并被绘制到应用程序中
例如:
<ListView
dataSource={this.state.datasource}
renderRow={this._renderRow.bind(this)}
onRenderFinish={() => console.log("Finished loading!")}
/>
console.log(“加载完毕!”)
/>
ListView不会一次呈现所有项目。它呈现需要显示的项目。只是好奇,为什么需要像“onRenderFinish”这样的回调?您试图通过此回调实现什么?是否签出了onEndReached
方法?ListView不会一次呈现所有项目。它呈现需要显示的项目。只是好奇,为什么需要像“onRenderFinish”这样的回调?您试图通过此回调实现什么?是否签出了onEndReached
方法?