Vsevolod Ganin
01/16/2021, 1:45 PMmatchParentSize
modifier is available only in BoxScope
? It could be useful in any layout scope I think, as well as matchParentWidth
and matchParentHeight
Timo Drick
01/16/2021, 1:47 PMVsevolod Ganin
01/16/2021, 1:52 PMColumn {
Text(...)
Canvas(modifier = Modifier.fillMaxWidth().height(1.dp)) {
drawLine(color, Offset(0f, 0f), Offset(size.width, 0f))
}
Text(...)
}
And I getCanvas
into account while measuring, I just want to set it to be in size as the rest of the content dictatesTimo Drick
01/16/2021, 1:57 PMromainguy
01/16/2021, 7:52 PMAdam Powell
01/16/2021, 8:02 PMmatchParentSize
in Box is an instruction to measure that element last, with whatever specific size the Box has already determined for itself, potentially from measuring its other child elements first.Timo Drick
01/16/2021, 8:20 PMColumn(Modifier.preferredWidth(IntrinsicSize.Min)) {
Text(text = "4")
Divider(modifier = Modifier.fillMaxWidth().preferredHeight(1.dp),color = Color.Black)
Text(text = "2")
}