https://kotlinlang.org logo
c

camkadev

01/31/2020, 9:48 AM
i try to run sample with Constraints but without luck because Tag modifier hidden somewhere, can't import them, any idea?
m

Mihai Popa

01/31/2020, 6:15 PM
Which sample exactly? The ConstraintLayout one?
c

codeslubber

01/31/2020, 7:28 PM
is there a ConstraintLayout sample??
m

Mihai Popa

01/31/2020, 8:46 PM
Yes, in ConstraintLayoutActivity.kt
👍🏻 1
c

carbaj0

02/01/2020, 6:49 AM
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)
2 Views