react-native-native-listview
react-native-native-listview copied to clipboard
android - backgroundColor for items makes the list not to render
If you comment out the backgroundColor style in container the rows will display, if you leave it as it is it won't
class ListExample extends Component {
render() {
return (
<View style={{ flex: 1 }}>
<NativeListview
renderRow={this.renderRow}
numRows={dataSource.length}
rowHeight={75}
style={{ flex: 1 }}
/>
</View>
);
}
renderRow(rowID) {
return (
<View style={styles.container}>
<Text style={{ width: 100, height: 50 }}>{dataSource[rowID]}</Text>
<Text style={styles.red}>{dataSource[rowID]}</Text>
<Image style={{ width: 100, height: 75 }} source={{ uri: 'https://unsplash.it/100/75?image=' + rowID }} />
</View>
);
}
}
export default class rnNativeListTest extends Component {
render() {
return <ListExample />;
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
backgroundColor:'orange',
height: 75,
width: Dimensions.get('window').width
},
red: {
width: 100,
height: 50,
backgroundColor: '#ff0000',
color: '#ffffff'
}
});