React Native: set the width of the view equal to its height when using percent

I have this stylesheet, and I'm trying to make the width of this equal to height when I set the height as a percentage. I am without success:

art: { height: "70%", width: styles.podcastArt.height, marginRight:10, marginTop:10, marginBottom:10, }, 

Any ideas or direction would be helpful. Thanks!

+5
source share
1 answer

set aspectRatio: 1

 art: { height: "70%", aspectRatio: 1, marginRight:10, marginTop:10, marginBottom:10, }, 
+6
source

Source: https://habr.com/ru/post/1273492/


All Articles