How do I leave a 1:1 image in React Native?

Asked

Viewed 19 times

-2

I have an image that I would like its width to be 100% the width of the screen and the height to be the same size as with (that is to say 100% the width of the screen), someone could help me with this?

code of my image:

export const Photo profile = Styled. Imagemargin-top: 26px; width: 100%; height: ?;;

  • Use: width: 100%; height: 100%; top: 0; left: 0; right: 0; bottom: 0; thus, it will take proportion of the screen per whole!

  • hello, but I do not want the image to take the intimate screen, what I want is it to be square, with the height of the same size as the width.

  • did not give, if I put that padding-top 100% the image almost some of the screen

No answers

Browser other questions tagged

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