Given this: ``` Row(modifier = Modifier ...
# compose
b
Given this:
Copy code
Row(modifier = Modifier
        .fillMaxWidth()
        .wrapContentHeight()) {
        
        Surface() {
            Text(...)           
        }
        
        Column {
            Text(...)
            Text(...)
            Text(...)
        }
    }
How do I get the
Surface
to be the same height as the
Column
?
l
I think you can add a
.weight(1f)
modifier to both of them
c
Im just subscribing to the thread here. I still suck at compose but my guess is that your height state should be hoisted up and therefore it could be shared by both?
l
I don't think that would work for dynamic heights though
b
.weight
is no good. I’ve actually already got a
weight
on the column to get it to fill the remaining horizontal space.
h
I'm not sure if it's the same thing but you can check out this thread for something similar https://kotlinlang.slack.com/archives/CJLTWPH7S/p1619641177056300?thread_ts=1619641029.056000&cid=CJLTWPH7S
l
If the height of the surface is always dependant of the column, maybe a ConstraintLayout would do the trick?
☝️ 1
f
You can use
IntrinsicSize
Copy code
Row(
        modifier = Modifier
            .fillMaxWidth()
            .height(IntrinsicSize.Min)
    ) {
          Surface(modifier = Modifier.fillMaxHeight()) {
            Text(text = "FooBar")
        }
        Column {
            Text(text = "FooBar1")
            Text(text = "FooBar2")
            Text(text = "FooBar3")
        }
    }
b
@Francesc
IntrinsicSize.Min
is exactly what I was looking for! Thanks!
👍 1