dimsuz
08/09/2021, 4:51 PMBox(modifier = Modifier.heightIn(min = 40.dp)) {
Canvas(modifier = Modifier.fillMaxHeight()) { ... }
OtherContent()
}
and Canvas
composable doesn't fill 40.dp
, and is 0.dp
in height actually. If I swap heightIn
with height(40.dp)
, then it works.
How do I make it so that child either fills 40.dp
or more if total Box height ends up to be larger (due to OtherContent
)?Lucien Guimaraes
08/09/2021, 4:53 PMrequiredHeight(40.dp)
instead of height()
or heightIn()
?dimsuz
08/09/2021, 4:57 PMrequiredHeightIn
🙂dimsuz
08/09/2021, 4:57 PMLucien Guimaraes
08/09/2021, 5:02 PMheightIn()
but you already tried it without success 🤔Lucien Guimaraes
08/09/2021, 5:03 PM.heightIn(min = 40.dp)
or just .heightIn(40.dp)
?dimsuz
08/09/2021, 5:05 PMmin
🙂Lucien Guimaraes
08/09/2021, 5:07 PMLucien Guimaraes
08/09/2021, 5:07 PM@Stable
fun Modifier.heightIn(
min: Dp = Dp.Unspecified,
max: Dp = Dp.Unspecified
) = ...
dimsuz
08/09/2021, 5:09 PMLucien Guimaraes
08/09/2021, 5:10 PMLucien Guimaraes
08/09/2021, 5:11 PMfillMaxHeight()
in your Canvas then, if you replace it with heigh(40.dp)
is it working ?dimsuz
08/09/2021, 5:18 PMLucien Guimaraes
08/09/2021, 5:23 PMdimsuz
08/09/2021, 5:24 PMheight
in my initial message.
I'll try to check if intrinsics will help me.dimsuz
08/09/2021, 5:29 PMheight(IntrinsicSize.Max)
on a Canvas
, this doesn't help either...Lucien Guimaraes
08/09/2021, 5:37 PMHeh, but I mentioned that it works withÂI though it was for the box modifier, not the Canvas in my initial message.height
Nope, If I putÂIf I'm not mistaken the on aÂheight(IntrinsicSize.Max)
, this doesn't help either...Canvas
IntrinsicSize
should be used in your parent Composable, not your children Composablesdimsuz
08/09/2021, 5:59 PM