React Native:使用百分比时将视图的宽度设置为等于其高度

use*_*409 10 css react-native

我有这个样式表,当我将高度设置为百分比时,我试图使其宽度等于高度.我以下没有成功:

art: {
    height: "70%",
    width: styles.podcastArt.height,
    marginRight:10,
    marginTop:10,
    marginBottom:10,
},
Run Code Online (Sandbox Code Playgroud)

任何想法或方向都会有所帮助.谢谢!

SiS*_*iSa 21

aspectRatio: 1

art: {
    height: "70%",
    aspectRatio: 1,
    marginRight:10,
    marginTop:10,
    marginBottom:10,
},
Run Code Online (Sandbox Code Playgroud)