我有这个样式表,当我将高度设置为百分比时,我试图使它的宽度等于高度。我以下没有成功:
art: {
height: "70%",
width: styles.podcastArt.height,
marginRight:10,
marginTop:10,
marginBottom:10,
},
任何想法或方向都会有所帮助。谢谢!
最佳答案
设置宽高比:1
art: {
height: "70%",
aspectRatio: 1,
marginRight:10,
marginTop:10,
marginBottom:10,
},
关于css - react native : Setting the width of a view equal to its height when using percentages,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47366871/