Skip to content

Full width image using flexbox? #950

Description

@joshbedo

I'm attempting to make an image full-width and came across a few stackoverflow questions related where the top upvoted answer was to use flexbox similarly to how i'm using it below. Although it doesn't seem to display the image unless i set static widths on my styles property. Any ideas?

varstyles= StyleSheet.create({
canvasContainer: {
flex:1,
alignItems: 'stretch'
},canvas: {
flex:1
// width: 200,
// height: 200
}
});
render: function(){return(<Viewstyle={styles.container}><Viewstyle={styles.canvasContainer}><Imagesource={{uri: 'http://imgs.steps.dragoart.com/how-to-draw-a-pony-step-7_1_000000053055_5.jpg'}}style={styles.canvas}/></View><ScrollViewstyle={styles.scrollView}scrollEventThrottle={200}contentInset={{top: 0}}>{this.state.messages.map(m=>{return<Textstyle={styles.message}>Josh: {m}</Text>})}</ScrollView></View>)}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions