是否可以指定重量和最小高度?

Is it possible to specify a weight and a minimum height?

我试图让一个元素的高度至少为 160 dp,但尽可能缩放以使用所有可用的 space。我想,也许这比我想象的要难。

下面的不行,但也许它传达了我想做的事情的想法。

Column(modifier = Modifier.verticalScroll(rememberScrollState()).fillMaxSize) {
    Box(modifier = Modifier.weight(1f).sizeIn(minHeight = 160.dp))
    Box(modifier = Modifier.height(600.dp))
}

当内容不适合屏幕时,我希望内容可以滚动,并且第一个框的高度为 160 dp。如果屏幕大于 760 dp,我希望第一个框尽可能多地填充 space 而无需滚动。

您可以使用BoxWithConstraints根据可用space定义自己的内容。
类似于:

BoxWithConstraints {
    val height = maxHeight
    Column(
        modifier = Modifier
            .background(Color.Red)
            .verticalScroll(state = rememberScrollState(0))
            .fillMaxSize()
    ) {

        val modifierBox1 : Modifier = if (height > 760.dp)
            Modifier.heightIn(height - 600.dp)
        else
            Modifier.heightIn(160.dp)

        Box(
            modifier = modifierBox1
                .fillMaxWidth()
                .background(Color.Blue)
        )
        Box(
            modifier = Modifier
                .height(600.dp)
                .fillMaxWidth()
                .background(Color.Green)
        )
    }
}