react-native-native-listview icon indicating copy to clipboard operation
react-native-native-listview copied to clipboard

both android and ios - alignItems breaks the layout

Open rborn opened this issue 8 years ago • 0 comments

If you set any value for alignItems for the container the layout breaks on both ios and android.

screen shot 2017-02-21 at 10 08 05 screen shot 2017-02-21 at 10 07 25

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

rborn avatar Feb 21 '17 09:02 rborn