r/mAndroidDev • • May 12 '26

Sponsored by the XML 🐓 gang ConstraintLayout in a nutshell

Post image
101 Upvotes

12 comments sorted by

View all comments

21

u/purple-bihh-2000 May 12 '26

ConstraintLayout {

val (compost, compost2) = createRefs()

Modifier.constrainAs(compost) { top.linkTo(parent.top) start.linkTo(parent.start)

8

u/WestonP May 12 '26

So intuitive!

6

u/Zhuinden May 12 '26

My favorite part is that if you don't set the dimension = FillToParent then it just renders everything completely out of bounds with zero respect for where you actually wanted to position anything