React-Native(iOS)中的ListView无法顺利运行

时间:2016-10-13 03:01:15

标签: ios listview react-native

看起来我的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运行时帧丢失了。

为什么会这样?谢谢。

0 个答案:

没有答案