[英]How to mention dimensionRation for ConstraintLayout with jetpack compose?
We have app:layout_constraintDimensionRatio
for ConstraintLayout while using in with XML. Likewise, how to use dimensionRatio with jetpack compose.在与 XML 一起使用时,我们有
app:layout_constraintDimensionRatio
用于 ConstraintLayout。同样,如何将 dimensionRatio 与 jetpack compose 一起使用。
Try with aspectRatio , you need to import尝试使用aspectRatio ,你需要导入
import androidx.compose.foundation.layout.aspectRatio
and then use it as follow然后按如下方式使用它
Box(modifier = Modifier.aspectRatio(0.5f))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.