最简单的ListView

来源:互联网 发布:数据包怎么上传到淘宝 编辑:程序博客网 时间:2024/05/16 05:00

'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});


0 0
原创粉丝点击