1.

What is ListView and describe its use in React Native ?

Answer»

React Native ListView is a VIEW component that contains the list of items and displays it in a vertically scrollable list.

export default class MyListComponent extends Component { constructor() { super(); const ds = new ListView.DATASOURCE({rowHasChanged: (r1, r2) => r1 !== r2}); this.state = { dataSource: ds.cloneWithRows(['Android','iOS', 'Java','Php', 'Hadoop', 'Sap', 'Python','Ajax', 'C++']), };} RENDER() { return ( <ListView dataSource={this.state.dataSource} renderRow={ (rowData) => <Text style={{fontSize: 30}}>{rowData}</Text>} /> ); } }


Discussion

No Comment Found