I have ```Box(modifier = Modifier.heightIn(min = 4...
# compose
d
I have
Copy code
Box(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
)?
l
have you tried
requiredHeight(40.dp)
instead of
height()
or
heightIn()
?
d
hmm. it would still not permit content to be larger than 40.dp. But you gave me an idea to try
requiredHeightIn
🙂
...and it didn't work! (at first I thought it did, but forgot to delete height modifier)
l
Sorry I wanted to say
heightIn()
but you already tried it without success 🤔
did you set
.heightIn(min = 40.dp)
or just
.heightIn(40.dp)
?
d
first, but they're equivalent in case of
min
🙂
l
you sure it's the same ? In the doc it's set as Unspecified by default
Copy code
@Stable
fun Modifier.heightIn(
    min: Dp = Dp.Unspecified,
    max: Dp = Dp.Unspecified
) = ...
d
I mean specifying name of the first argument doesn't change semantics of the call, min will be set to 40.dp
l
ah my bad, I misunderstood
the issue must be related to
fillMaxHeight()
in your Canvas then, if you replace it with
heigh(40.dp)
is it working ?
d
yes, but that's not my intention. I want the canvas to fill the whole box height, see my original question. Box might be bigger than 40.dp
l
I just wanted to know if it was working with height(), so here the issue must be related to Canvas being unable to know the height of your Box. So you might need to go through intrinsic measurements
d
Heh, but I mentioned that it works with
height
in my initial message. I'll try to check if intrinsics will help me.
Nope, If I put
height(IntrinsicSize.Max)
on a
Canvas
, this doesn't help either...
l
Heh, but I mentioned that it works with 
height
 in my initial message.
I though it was for the box modifier, not the Canvas
Nope, If I put 
height(IntrinsicSize.Max)
 on a 
Canvas
, this doesn't help either...
If I'm not mistaken the
IntrinsicSize
should be used in your parent Composable, not your children Composables
d
But I want my Box to be 40.dp or larger if content is larger. I can't put intrinsic modifier on it.