react-native-native-listview
react-native-native-listview copied to clipboard
both android and ios - alignItems breaks the layout
If you set any value for alignItems
for the container
the layout breaks on both ios and android.
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',
alignItems: 'center',
height: 75,
width: Dimensions.get('window').width
},
red: {
width: 100,
height: 50,
backgroundColor: '#ff0000',
color: '#ffffff'
}
});