Per Jansson
05/04/2023, 2:50 PMoverflow: hidden | clip
to achieve the same.
In the example below both boxes will log that they are 200 in size, I would like the blue one to be 400 but only the top 200 would be visible.
Box(
modifier = Modifier
.size(200.dp)
.background(Color.Yellow)
.onGloballyPositioned { coordinates ->
Log.d("BoxSize", "OUTER Width: ${coordinates.size.width}, Height: ${coordinates.size.height}")
}
) {
Box(
modifier = Modifier
.fillMaxWidth()
.height(400.dp)
.background(Color.Blue)
.onGloballyPositioned { coordinates ->
Log.d("BoxSize", "INNER Width: ${coordinates.size.width}, Height: ${coordinates.size.height}")
}
)
}
Zach Klippenstein (he/him) [MOD]
05/04/2023, 3:09 PMvide
05/04/2023, 3:09 PMwrapContentSize
modifierromainguy
05/04/2023, 3:10 PM.graphicsLayer { clip = true }
Zach Klippenstein (he/him) [MOD]
05/04/2023, 3:10 PMvide
05/04/2023, 3:11 PM.wrapContentHeight(unbounded = true).height(400.dp)
on the inner composable.wrapContentHeight(unbounded = true, align = ...)
Per Jansson
05/04/2023, 3:49 PM