Divyesh Vasoya
Divyesh Vasoya

Reputation: 39

react native - image not showing properly

I'm using the normal image tag to display server image but some images are showing properly and some are not.

<View>
   <Image 
     style={{borderWidth:1,
     width: responsiveWidth(100),
     height: responsiveHeight(50),
     resizeMode:'contain'}} 
     source = {{ uri:this.state.productimage}}/>
</View>

this is how my product image is looking like

Upvotes: 0

Views: 3249

Answers (2)

Yash Vaghela
Yash Vaghela

Reputation: 612

provide height-width in style of image tag

<Image 
source = {{ uri:"http://pngimg.com/uploads/google/google_PNG19632.png" }} 
style = {{ height:100, width:100 }}/>

Upvotes: 0

chetan godiya
chetan godiya

Reputation: 316

if you want to display your server image in grid then may be this works for you

<Image source={{uri:"http://pngimg.com/uploads/google/google_PNG19632.png"}} style={{height:null,width:null,flex:0.5,resizeMode:'contain'}}  />

or change resizeMode:'cover'

Upvotes: 1

Related Questions