FlowColumnScope
-
Cmn
@LayoutScopeMarker
interface FlowColumnScope : ColumnScope
FlowColumnOverflowScope |
Scope for the overflow |
ContextualFlowColumnOverflowScope |
This interface is deprecated. ContextualFlowLayouts are no longer maintained |
Scope for the children of FlowColumn.
Summary
Public functions |
||
|---|---|---|
Modifier |
@ExperimentalLayoutApiHave the item fill (possibly only partially) the max width of the widest item in the column it was placed in, within the |
Cmn
|
Inherited functions |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public functions
fillMaxColumnWidth
@ExperimentalLayoutApi
fun Modifier.fillMaxColumnWidth(
fraction: @FloatRange(from = 0.0, to = 1.0) Float = 1.0f
): Modifier
Have the item fill (possibly only partially) the max width of the widest item in the column it was placed in, within the FlowColumn.
import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.FlowColumn import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.layout.wrapContentWidth 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 FlowColumn( Modifier.padding(20.dp) .wrapContentHeight(align = Alignment.Top) .wrapContentWidth(align = Alignment.Start), horizontalArrangement = Arrangement.spacedBy(10.dp), verticalArrangement = Arrangement.spacedBy(20.dp), maxItemsInEachColumn = 3, ) { repeat(9) { Box(Modifier.height(100.dp).fillMaxColumnWidth(1f).background(Color.Green)) { val text = generateRandomString(IntRange(1, 5).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 width of the widest item between Example usage: |