react native - Recycler view can't be displayed -
i follow npm documentation recylerview react-native-recycler-listview .
i have checked steps described in documentation. when running result :
this code :
/** import react, { component } 'react'; import { appregistry, stylesheet, text, view, dimensions } 'react-native'; import listviewcustom 'react-native-recycler-listview'; export default class menu extends component { constructor(props) { super(props); var array = []; for(var = 0; < 100; i++){ array.push({"title":"title","subtitle":"subtiles"}); } this.state = { datasource:{"names": array} }; } render() { return ( <view style={styles.container}> <listviewcustom src={this.state.datasource} customstyle={{"fontsize":"12","padding":"0","fontcolor":"red"}} style={{flex:1,width:dimensions.get('window').width, }}> </listviewcustom> </view> ); } } const styles = stylesheet.create({ container: { flex: 1, } })
any appreciated
Comments
Post a Comment