Uri in image is not appearing

Asked

Viewed 175 times

0

Ola, So I’m doing a project, and I need the user image to appear right away when it’s loaded. For this I’m using firebase Storage, and I can get the URL of the image I need, which in this case is : https://firebasestorage.googleapis.com/v0/b/projetotindoar.appspot.com/o/images%2FhAV6dDpbHxgWV9XJnd76gnK2x513? alt=media&token=58815f99-7dfd-440b-8f34-6de363b8f0e5

However, using the code below, the image is not showing. What I do?

Code :

{/*Foto do Usuario*/}
<View style={styles.fotoUsuario}>
{console.log("URL DA IMAGEM : ",this.state.imgUrl)}
  <Image source={{uri:this.state.imgUrl}}/>
</View>

The result that appears in the console.log is the same link mentioned above. Thanks in advance.

William.

  • Add how the style is, the content of the styles.fotoUsuario. I already say that for the image to be shown you should put the values of height and width

1 answer

1

The resolution of the image is too large to appear on the mobile screen. To solve, just add width and height in image style.

<Image
  style={{width: 150, height: 150}}
  source={{uri:'https://firebasestorage.googleapis.com/v0/b/projetotindoar
    .appspot.com/o/images%2FhAV6dDpbHxgWV9XJnd76gnK2x513?alt=media&token=5881
    5f99-7dfd-440b-8f34-6de363b8f0e5'
  }}
/>
  • That was exactly the problem. Thank you very much

  • 1

    If the answer has solved your problem, mark it as right.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.