您的位置:首页 > 移动开发 > IOS开发

最简单的ListView

2016-02-02 18:28 621 查看
'use strict'

var React = require('react-native');
var{
ListView,
View,
Text
} = React;

class WebViewExample extends React.Component{

constructor(props) {
super(props);
var dataSource = new ListView.DataSource(
{rowHasChanged: (r1, r2) => r1 !== r2});
this.state = {
dataSource: dataSource.cloneWithRows(['推送', '清除缓存','关于我们','我要反馈']),
};
}

render() {
return (
<ListView
dataSource={this.state.dataSource}
renderRow={(rowData) => <Text>{rowData}</Text>}
/>
);
}
}

React.AppRegistry.registerComponent('WebViewExample', function() { return WebViewExample});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios mac native xcode