看起来我的ListView有问题,它运行不顺畅;
守则:
class ZpRNProj extends Component {
constructor(){
super() ;
let contentArr = [
'fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','end01',
'fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','end02',
'fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','fdsfdfs','end03',] ;
var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}) ;
this.state = {dataSource:ds.cloneWithRows(contentArr)}
}
render(){
return (
<ListView
dataSource={this.state.dataSource}
renderRow={(rowData, sectionID, rowID, highlightRow) =>{
return <Text>{rowData}-{sectionID}-{rowID}-{highlightRow}</Text>
}}
>
</ListView>
) ;
}
}
AppRegistry.registerComponent('ZpRNProj', () => ZpRNProj);
我发现App运行时帧丢失了。
为什么会这样?谢谢。