I am trying to align this component to bottom of p...
# compose
j
I am trying to align this component to bottom of parent, but it is not working, even it is giving error
Copy code
CustomTextField(
    text = message, onValueChange = { message = it },
    onSend = onSend,
    modifier = Modifier.constrainAs(bottom) {
       // top.linkTo(box.bottom, margin = 16.dp)
        top.linkTo(box.bottom, margin = 16.dp)
        end.linkTo(parent.end)
        bottom.linkTo(parent.end)
      
},
)
it keep giving error “Unresolved reference: linkTo” on bottom.linkto(parent.end)
k
should this be
bottom.linkTo(parent.bottom)
?
Otherwise you’re saying align my bottom edge to the parent’s end edge (which is right edge under LTR and left edge under RTL)
j
sorry for wrong, I want to put this item on bottom of the screen
bottom.linkTo(parent.bottom)
this is also saying same error
k
What’s the full stack trace / compile error message?
j
not compiling, giving error in tooltip “Unresolved reference: linkTo”
d
You're using bottom as a ConstrainedLayoutReference in Modifier.constrainAs(bottom). That's causing a conflict. Change the name to something else.
j
My bad, thanks for a catch, now it is working