FlowRowScope
-
Cmn
@LayoutScopeMarker
interface FlowRowScope : RowScope
FlowRowOverflowScope |
Scope for the overflow |
ContextualFlowRowOverflowScope |
This interface is deprecated. ContextualFlowLayouts are no longer maintained |
Scope for the children of FlowRow.
Summary
Public functions |
||
|---|---|---|
Modifier |
@ExperimentalLayoutApiHave the item fill (possibly only partially) the max height of the tallest item in the row it was placed in, within the |
Cmn
|
Inherited functions |
|||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public functions
fillMaxRowHeight
@ExperimentalLayoutApi
fun Modifier.fillMaxRowHeight(
fraction: @FloatRange(from = 0.0, to = 1.0) Float = 1.0f
): Modifier
Have the item fill (possibly only partially) the max height of the tallest item in the row it was placed in, within the FlowRow.
import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.material.Text import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp FlowRow( Modifier.fillMaxWidth(1f).padding(20.dp).wrapContentHeight(align = Alignment.Top), horizontalArrangement = Arrangement.spacedBy(10.dp), verticalArrangement = Arrangement.spacedBy(20.dp), maxItemsInEachRow = 3, ) { repeat(9) { Box(Modifier.width(100.dp).background(Color.Green).fillMaxRowHeight(1f)) { val text = generateRandomString(IntRange(10, 50).random()) Text(text = text, fontSize = 18.sp, modifier = Modifier.padding(3.dp)) } } }
| Parameters | |
|---|---|
fraction: @FloatRange(from = 0.0, to = 1.0) Float = 1.0f |
The fraction of the max height of the tallest item between Example usage: |