Skip to content
This repository has been archived by the owner on Apr 16, 2018. It is now read-only.

android - backgroundColor for items makes the list not to render #4

Open
rborn opened this issue Feb 21, 2017 · 0 comments
Open

android - backgroundColor for items makes the list not to render #4

rborn opened this issue Feb 21, 2017 · 0 comments

Comments

@rborn
Copy link

rborn commented Feb 21, 2017

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'
    }
});
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant