Hi! How do I make a `Box` height 2/3 of the parent...
# compose
t
Hi! How do I make a
Box
height 2/3 of the parent box intrinsic height?
c
Modifier.fillMaxHeight(2 / 3f)
, providing the
Box
has a constrained height.
t
the parent box has no size constrain unfortunately
The layout I want looks something like this
currently i have
Column
overlapping the white
Box
underneath
Copy code
Box {
  Box {} <- white box
  Column {} <- content
}
I got it! For anyone looking for the solution to this you could do something like this
Copy code
Box(Modifier.fillMaxHeight(IntrinsicSize.Min)) {
  Box {Modifier.fillMaxHeight(.85f)}
  Column {} <- content
}
p
But that's not 2/3 🙂
😂 3
t
yeah it’s more like 4/5 lol
c
I keep hearing "intrinsic" height/width. Noob here. What is intrinsic?
t
You can take a look at this. It’s explained quite well here https://developer.android.com/jetpack/compose/layouts/intrinsic-measurements
👍 1