Reputation: 320
We have app:layout_constraintDimensionRatio
for ConstraintLayout while using in with XML. Likewise, how to use dimensionRatio with jetpack compose.
Upvotes: 1
Views: 191
Reputation: 2709
Try with aspectRatio, you need to import
import androidx.compose.foundation.layout.aspectRatio
and then use it as follow
Box(modifier = Modifier.aspectRatio(0.5f))
Upvotes: 1