Row

interface Row<T : Modifier> : Layout<T>

表示一个 Jetpack Compose Row 布局的接口定义。

此接口提供了一种声明式、构建器风格(builder-style)的方式来配置 Row 的核心属性。 Row 是一个布局组件,它将其子项(children)按水平顺序依次放置。

主要功能包括:

Author

M8Test, [email protected], https://m8test.com

Parameters

T

Modifier 的具体类型,用于实现链式调用和扩展。

See also

androidx.compose.foundation.layout.Row

官方 Row Composable 文档

Functions

Link copied to clipboard
abstract fun DisposableEffect(disposableEffectBuilder: DisposableEffect.() -> Unit)
Link copied to clipboard
Link copied to clipboard
abstract fun <V> getCompositionLocalValue(compositionLocal: ProvidableCompositionLocal<V>): V?

获取 compositionLocal 的值

Link copied to clipboard
abstract fun getContext(): ScriptContext

获取脚本上下文对象 ScriptContext.

Link copied to clipboard
abstract fun LaunchedEffect(launchedEffectBuilder: LaunchedEffect.() -> Unit)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun setContent(contentBuilder: RowScopeSlot.() -> Unit)

定义 Row 内部的 Composable 内容。

Link copied to clipboard
abstract fun setHorizontalArrangement(builder: (arrangements: RowArrangements) -> ArrangementHorizontal)

设置子组件在主轴(水平)方向上的排列方式。

Link copied to clipboard
abstract fun setModifier(modifierBuilder: T.() -> Unit)
Link copied to clipboard
abstract fun setVerticalAlignment(builder: (alignments: RowAlignments) -> AlignmentVertical)

设置子组件在交叉轴(垂直)方向上的对齐方式。

Link copied to clipboard
abstract fun setVisible(visible: Boolean)

设置显示/隐藏当前 Composable

Link copied to clipboard
abstract fun SideEffect(sideEffectBuilder: SideEffect.() -> Unit)
Link copied to clipboard

设置所有需要用到的聚合状态,例如 DrawerState, BottomSheetState 等

Link copied to clipboard
abstract fun trackSingleState(state: SingleState)

添加当前 Composable 需要监听的状态,如果状态改变的话 Composable 会重组