Quick question, I want to have a layout where children views can place themselves wherever they want (x y relative to the parent layout)… not sure how to acomplish this in #Compose 🤔
Tried creating a custom layout and using:
Copy code
placeable.placeRelative(x = 0, y = 0)
but I don’t have a way of asking the view where it wants to be placed
frankelot
12/07/2020, 6:14 PM
I understand that in 99% of cases the
layout
should be the one in charge of placing its children views… but I want to create a set of draggable views that the user can move around freely
r
Rafs
12/07/2020, 6:20 PM
You can use a Box as the parent composable and give it a modifier of
fillMaxSize()
After that you can place your children using
Modifier.Offset(x, y)
f
frankelot
12/07/2020, 6:20 PM
👀 that looks promising, thanks @Rafs! will give it a try
b
bruno.aybar
12/08/2020, 12:07 AM
There's also BiasAlignment , which allows you to align content given a bias