i try to run sample with Constraints but without l...
# compose
c
i try to run sample with Constraints but without luck because Tag modifier hidden somewhere, can't import them, any idea?
m
Which sample exactly? The ConstraintLayout one?
c
is there a ConstraintLayout sample??
m
Yes, in ConstraintLayoutActivity.kt
👍🏻 1
c
Copy code
val half = createGuidelineFromLeft(percent = 0.5f)
text1.apply {
    left constrainTo half
    left.margin = 50.dp
    bottom constrainTo <http://text2.top|text2.top>
}
Copy code
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.acv.arrowcompose, PID: 12969
    java.lang.AssertionError: LEFT
        at androidx.constraintlayout.solver.widgets.Guideline.getAnchor(Guideline.java:156)
        at androidx.constraintlayout.solver.state.ConstraintReference.applyConnection(ConstraintReference.java:568)
        at androidx.constraintlayout.solver.state.ConstraintReference.apply(ConstraintReference.java:633)
        at androidx.ui.layout.constraintlayout.ConstraintSetBuilderScope$Companion$verticalAnchorFunctions$1.invoke(ConstraintLayout.kt:534)
        at androidx.ui.layout.constraintlayout.ConstraintSetBuilderScope$Companion$verticalAnchorFunctions$1.invoke(Unknown Source:3)
        at androidx.ui.layout.constraintlayout.ConstraintSetBuilderScope$VerticalAnchor$ConstrainedLayoutAnchor.constrainTo(ConstraintLayout.kt:239)