https://kotlinlang.org logo
Title
d

David W

12/21/2021, 12:40 AM
The height of Box is 0 and I'm not sure why.
Row(modifier) {
        Box(
            modifier = Modifier
                .width(24.dp)
                .fillMaxHeight()
                .background(color = Color.Blue)
        )
        Text(modifier = Modifier.align(Alignment.CenterVertically), text = "Theme")
    }
If I hardcode the height, I get a blue box
looks like this, the space on the left is where the Box is (with 0 height)
well, "solved" it for now by just hardcoding it /shrug
c

Chris Sinco [G]

12/21/2021, 4:44 AM
You might need to add brackets to the end of the Box to denote empty content?
You can also try the weight modifier
d

David W

12/21/2021, 8:18 PM
Thanks but neither of those worked. Curly braces are optional and do nothing if not added, and Weight wouldn't apply to height, because this is in a Row
(I tried both anyway and confirmed they don't make a difference)
c

Chris Sinco [G]

12/21/2021, 9:13 PM
What is being passed in the modifier in the parent Row?
You may need to have the parent add height with
Instrinsic.Min