https://kotlinlang.org logo
#compose
Title
# compose
t

Travis Griggs

11/30/2023, 7:55 PM
Is it possible to have elements in a Row "overlap" each other slightly? I'm trying to get the effect shown. My thought was to use CutCornerShape with distinct corners set to 100%. It works like a charm except, I need the layouts to overlap by half the hieght so the diagnol edges "sync up". I can probably do this with Box I imagine, but wondered if it could be done with Row?
a

andriyo

11/30/2023, 9:51 PM
It could be a third component for overlapping area only, then it could be in a Row
t

Travis Griggs

11/30/2023, 10:02 PM
Figured it out. You can apply a negative spaceBy to the arrangement:
Copy code
Row(horizontalArrangement = Arrangement.spacedBy(-40.dp))
Works in my case, because were setting a specific known/constant height so the spaced by can be the same value.
8 Views