constrainedWidth/constrainedHeight in Jetpack Compose with ConstraintLayout

Viewed 463

How to set constrained width/height in Compose?

Text("Test", Modifier.constrainAs(text) {
    linkTo(
        start = parent.start,
        top = button.bottom,
        end = parent.end,
        bottom = parent.bottom,
        topMargin = 16.dp,
        horizontalBias = 0f
    )
    width = Dimension.wrapContent // this is default, can be removed
    // now I need to set constrainedWidth somehow like in XML app:layout_constrainedWidth 
})

width = Dimension.preferredWrapContent mb this one is equal to

 android:layout_width="wrap_content"
 app:layout_constrainedWidth="true"

?

0 Answers
Related