Compose 修飾符清單

動作

範圍:任何
<T : Any?> Modifier.anchoredDraggable(
    state: AnchoredDraggableState<T>,
    orientation: Orientation,
    enabled: Boolean,
    interactionSource: MutableInteractionSource?,
    overscrollEffect: OverscrollEffect?,
    flingBehavior: FlingBehavior?
)

在一組預先定義的值之間啟用拖曳手勢。

範圍:任何
<T : Any?> Modifier. anchoredDraggable(
    state: AnchoredDraggableState<T>,
    orientation: Orientation,
    enabled: Boolean,
    interactionSource: MutableInteractionSource?,
    overscrollEffect: OverscrollEffect?,
    startDragImmediately: Boolean,
    flingBehavior: FlingBehavior?
)

這個函式已淘汰。 startDragImmediatemediate 已遭移除,且不會進行替換。

範圍:任何
<T : Any?> Modifier.anchoredDraggable(
    state: AnchoredDraggableState<T>,
    reverseDirection: Boolean,
    orientation: Orientation,
    enabled: Boolean,
    interactionSource: MutableInteractionSource?,
    overscrollEffect: OverscrollEffect?,
    flingBehavior: FlingBehavior?
)

在一組預先定義的值之間啟用拖曳手勢。

範圍:任何
<T : Any?> Modifier. anchoredDraggable(
    state: AnchoredDraggableState<T>,
    reverseDirection: Boolean,
    orientation: Orientation,
    enabled: Boolean,
    interactionSource: MutableInteractionSource?,
    overscrollEffect: OverscrollEffect?,
    startDragImmediately: Boolean,
    flingBehavior: FlingBehavior?
)

這個函式已淘汰。 startDragImmediatemediate 已遭移除,且不會進行替換。

範圍:任何
Modifier.clickable(
    enabled: Boolean,
    onClickLabel: String?,
    role: Role?,
    onClick: () -> Unit
)

將元件設為透過輸入或無障礙的「點擊」事件接收點擊。

範圍:任何
Modifier.clickable(
    interactionSource: MutableInteractionSource?,
    indication: Indication?,
    enabled: Boolean,
    onClickLabel: String?,
    role: Role?,
    onClick: () -> Unit
)

將元件設為透過輸入或無障礙的「點擊」事件接收點擊。

範圍:任何
Modifier.combinedClickable(
    enabled: Boolean,
    onClickLabel: String?,
    role: Role?,
    onLongClickLabel: String?,
    onLongClick: (() -> Unit)?,
    onDoubleClick: (() -> Unit)?,
    hapticFeedbackEnabled: Boolean,
    onClick: () -> Unit
)

設定元件以接收輸入或無障礙功能的「點擊」事件的點擊、按兩下和長按。

範圍:任何
Modifier.combinedClickable(
    interactionSource: MutableInteractionSource?,
    indication: Indication?,
    enabled: Boolean,
    onClickLabel: String?,
    role: Role?,
    onLongClickLabel: String?,
    onLongClick: (() -> Unit)?,
    onDoubleClick: (() -> Unit)?,
    hapticFeedbackEnabled: Boolean,
    onClick: () -> Unit
)

設定元件以接收輸入或無障礙功能的「點擊」事件的點擊、按兩下和長按。

範圍:任何
Modifier.draggable2D(
    state: Draggable2DState,
    enabled: Boolean,
    interactionSource: MutableInteractionSource?,
    startDragImmediately: Boolean,
    onDragStarted: (startedPosition: Offset) -> Unit,
    onDragStopped: (velocity: Velocity) -> Unit,
    reverseDirection: Boolean
)

為 UI 元素設定兩種螢幕方向的觸控拖曳功能。

範圍:任何
Modifier.draggable(
    state: DraggableState,
    orientation: Orientation,
    enabled: Boolean,
    interactionSource: MutableInteractionSource?,
    startDragImmediately: Boolean,
    onDragStarted: suspend CoroutineScope.(startedPosition: Offset) -> Unit,
    onDragStopped: suspend CoroutineScope.(velocity: Float) -> Unit,
    reverseDirection: Boolean
)

為單一 Orientation 中的使用者介面元素設定觸控拖曳功能。

範圍:任何

針對無障礙功能,使用此修飾符將 selectable 項目 (例如 Tab 或 RadioButtons) 清單分組。

範圍:任何
Modifier.selectable(
    selected: Boolean,
    enabled: Boolean,
    role: Role?,
    onClick: () -> Unit
)

將元件設為可選取 (通常屬於互斥群組,而且在任何時間點只能選取一個項目)。

範圍:任何
Modifier.selectable(
    selected: Boolean,
    interactionSource: MutableInteractionSource?,
    indication: Indication?,
    enabled: Boolean,
    role: Role?,
    onClick: () -> Unit
)

將元件設為可選取 (通常屬於互斥群組,而且在任何時間點只能選取一個項目)。

範圍:任何
@ExperimentalMaterialApi
<T : Any?> Modifier. swipeable(
    state: SwipeableState<T>,
    anchors: Map<Float, T>,
    orientation: Orientation,
    enabled: Boolean,
    reverseDirection: Boolean,
    interactionSource: MutableInteractionSource?,
    thresholds: (from, to) -> ThresholdConfig,
    resistance: ResistanceConfig?,
    velocityThreshold: Dp
)

此函式已淘汰不用。Material 的滑動式介面已由 Foundation 的 AnchoredDraggable API 取代。

範圍:任何
@ExperimentalWearMaterialApi
<T : Any?> Modifier.swipeable(
    state: SwipeableState<T>,
    anchors: Map<Float, T>,
    orientation: Orientation,
    enabled: Boolean,
    reverseDirection: Boolean,
    interactionSource: MutableInteractionSource?,
    thresholds: (from, to) -> ThresholdConfig,
    resistance: ResistanceConfig?,
    velocityThreshold: Dp
)

在一組預先定義的狀態之間啟用滑動手勢。

範圍:任何
Modifier.toggleable(
    value: Boolean,
    enabled: Boolean,
    role: Role?,
    onValueChange: (Boolean) -> Unit
)

將元件設定為可透過輸入和無障礙事件進行切換

範圍:任何
Modifier.toggleable(
    value: Boolean,
    interactionSource: MutableInteractionSource?,
    indication: Indication?,
    enabled: Boolean,
    role: Role?,
    onValueChange: (Boolean) -> Unit
)

將元件設定為可透過輸入和無障礙事件進行切換。

範圍:任何
Modifier.triStateToggleable(
    state: ToggleableState,
    enabled: Boolean,
    role: Role?,
    onClick: () -> Unit
)

將元件設為可透過輸入和無障礙事件三種狀態切換:「開啟」、「關閉」和「不確定」。

範圍:任何
Modifier.triStateToggleable(
    state: ToggleableState,
    interactionSource: MutableInteractionSource?,
    indication: Indication?,
    enabled: Boolean,
    role: Role?,
    onClick: () -> Unit
)

將元件設為可透過輸入和無障礙事件三種狀態切換:「開啟」、「關閉」和「不確定」。

@ExperimentalMaterial3AdaptiveApi
Modifier.paneExpansionDraggable(
    state: PaneExpansionState,
    minTouchTargetSize: Dp,
    interactionSource: MutableInteractionSource
)

修飾符應套用至拖曳控點可組合項,這樣才能在提供的 PaneExpansionState 上正確拖曳拖曳控點和操作。

對齊方式

範圍: RowScope

Row 中垂直對齊元素。

範圍: RowScope
Modifier.alignBy(alignmentLineBlock: (Measured) -> Int)

垂直放置元素,讓 alignmentLineBlock 決定的內容的對齊線和同樣設定為 alignBy 的同層級元素對齊。

範圍: RowScope

垂直放置元素,讓其 alignmentLine 與同樣設定為 alignBy 的同層級元素對齊。

範圍: RowScope

垂直放置元素,讓第一個基準和同樣設定為 alignByBaselinealignBy 的同層級元素對齊。

範圍: ColumnScope

Column 中水平對齊元素。

範圍: ColumnScope
Modifier.alignBy(alignmentLineBlock: (Measured) -> Int)

水平放置元素,讓 alignmentLineBlock 決定的內容的對齊線和同樣設定為 alignBy 的同層級元素對齊。

範圍: ColumnScope

水平放置元素,讓其 alignmentLine 和同樣設定為 alignBy 的同層級元素對齊。

範圍: BoxScope
Modifier.align(alignment: Alignment)

將內容元素置入到 Box 中的特定 Alignment

Animation

範圍:任何
@ExperimentalSharedTransitionApi
Modifier.animateBounds(
    lookaheadScope: LookaheadScope,
    modifier: Modifier,
    boundsTransform: BoundsTransform,
    animateMotionFrameOfReference: Boolean
)

Modifier 可建立 LookaheadScope 內版面配置變更 (位置和/或大小) 的動畫。

範圍:任何
@ExperimentalMaterial3ExpressiveApi
Modifier.animateFloatingActionButton(
    visible: Boolean,
    alignment: Alignment,
    targetScale: Float,
    scaleAnimationSpec: AnimationSpec<Float>?,
    alphaAnimationSpec: AnimationSpec<Float>?
)

FloatingActionButton 套用此修飾符,以動畫顯示或隱藏元素,通常以應用程式的主要內容捲動為基礎。

open
Modifier.animateEnterExit(
    enter: EnterTransition,
    exit: ExitTransition,
    label: String
)

animateEnterExit 修飾符可用於 AnimatedVisibility 的任何直接或間接子項,建立與 AnimatedVisibility 中所指定不同的進入/結束動畫。

範圍: LazyItemScope
open
Modifier.animateItem(
    fadeInSpec: FiniteAnimationSpec<Float>?,
    placementSpec: FiniteAnimationSpec<IntOffset>?,
    fadeOutSpec: FiniteAnimationSpec<Float>?
)

這個修飾符可製作項目外觀 (淡入)、消失 (淡出) 和位置變更 (例如重新排序項目) 的動畫效果。

Modifier.animateItem(
    fadeInSpec: FiniteAnimationSpec<Float>?,
    placementSpec: FiniteAnimationSpec<IntOffset>?,
    fadeOutSpec: FiniteAnimationSpec<Float>?
)

這個修飾符可製作項目外觀 (淡入)、消失 (淡出) 和位置變更 (例如重新排序項目) 的動畫效果。

Modifier.animateItem(
    fadeInSpec: FiniteAnimationSpec<Float>?,
    placementSpec: FiniteAnimationSpec<IntOffset>?,
    fadeOutSpec: FiniteAnimationSpec<Float>?
)

這個修飾符可製作項目外觀 (淡入)、消失 (淡出) 和位置變更 (例如重新排序項目) 的動畫效果。

框線

範圍:任何
Modifier.border(border: BorderStroke, shape: Shape)

修改元素以新增使用 bordershape 指定的外觀框線,並進行裁剪。

範圍:任何
Modifier.border(width: Dp, brush: Brush, shape: Shape)

修改元素以新增使用 widthbrushshape 指定的外觀框線,並進行裁剪。

範圍:任何
Modifier.border(width: Dp, color: Color, shape: Shape)

修改元素以新增使用 widthcolorshape 指定的外觀框線,並進行裁剪。

繪圖

範圍:任何
Modifier.alpha(alpha: Float)

繪製修改 alpha 值可能小於 1 的內容。

範圍:任何
Modifier.background(color: Color, shape: Shape)

在內容後方以實心 color 繪製 shape

範圍:任何
Modifier.background(
    brush: Brush,
    shape: Shape,
    alpha: @FloatRange(from = 0.0, to = 1.0) Float
)

在內容下方使用 brush 繪製 shape

範圍:任何
Modifier.clip(shape: Shape)

根據 shape 剪輯內容。

範圍:任何

根據此修飾符定義的圖層邊界,裁剪內容。

範圍:任何
Modifier.drawBehind(onDraw: DrawScope.() -> Unit)

繪製在修改內容後方的 Canvas 中。

範圍:任何
Modifier.drawWithCache(onBuildDrawCache: CacheDrawScope.() -> DrawResult)

只要繪製區域的大小相同,或者所讀取的任何狀態物件未變更,即在 DrawScope 中繪圖,且內容會在繪製呼叫期間持續顯示。

範圍:任何

建立 DrawModifier,讓開發人員可在版面配置內容之前或之後進行繪製。

範圍:任何
Modifier.indication(
    interactionSource: InteractionSource,
    indication: Indication?
)

在發生互動時對此元件繪製視覺效果。

範圍:任何
Modifier.paint(
    painter: Painter,
    sizeToIntrinsics: Boolean,
    alignment: Alignment,
    contentScale: ContentScale,
    alpha: Float,
    colorFilter: ColorFilter?
)

使用 painter 繪製內容。

範圍:任何
Modifier.shadow(
    elevation: Dp,
    shape: Shape,
    clip: Boolean,
    ambientColor: Color,
    spotColor: Color
)

建立繪製陰影的 graphicsLayer

範圍:任何

加上邊框間距以配合 safe drawing 的插邊。

範圍:任何
Modifier.zIndex(zIndex: Float)

建立修飾符,用於控制相同版面配置父項的子項繪製順序。

對焦

範圍:任何
Modifier.onFocusChanged(onFocusChanged: (FocusState) -> Unit)

對元件新增此修飾符以觀察焦點狀態事件。

範圍:任何
Modifier.onFocusEvent(onFocusEvent: (FocusState) -> Unit)

對元件新增此修飾符以觀察焦點狀態事件。

範圍:任何

此函式已淘汰不用。已由 focusTarget 取代

範圍:任何

對元件新增此修飾符使其可成為焦點。

範圍:任何
Modifier. focusOrder(focusOrderReceiver: FocusOrder.() -> Unit)

此函式已淘汰不用。請改用 focusProperties()

範圍:任何
Modifier. focusOrder(focusRequester: FocusRequester)

此函式已淘汰不用。請改用 FocusRequester()

範圍:任何
Modifier. focusOrder(
    focusRequester: FocusRequester,
    focusOrderReceiver: FocusOrder.() -> Unit
)

此函式已淘汰不用。請改用 focusProperties() 和 focusRequester()

範圍:任何

這個修飾符可讓您指定屬性,讓修飾符鏈之下或子版面配置節點上的 focusTarget 存取。

範圍:任何

在元件中加入這個修飾符,用來要求變更焦點。

範圍:任何

這個修飾符可用於儲存及還原焦點群組。

範圍:任何

此函式已淘汰不用。請改用 FocusRestorer(FocusRequester)

範圍:任何

建立焦點群組或將此元件標示為焦點群組。

範圍:任何
Modifier.focusable(
    enabled: Boolean,
    interactionSource: MutableInteractionSource?
)

將元件設定為可透過焦點系統或無障礙的「焦點」事件成為可聚焦。

範圍:任何
Modifier.onFocusedBoundsChanged(
    onPositioned: (LayoutCoordinates?) -> Unit
)

當目前焦點區域的邊界變更時呼叫 onPositioned

圖像

範圍:任何

Modifier.Node 可讓內容繪製到繪圖圖層中。

範圍:任何
Modifier.graphicsLayer(
    scaleX: Float,
    scaleY: Float,
    alpha: Float,
    translationX: Float,
    translationY: Float,
    shadowElevation: Float,
    rotationX: Float,
    rotationY: Float,
    rotationZ: Float,
    cameraDistance: Float,
    transformOrigin: TransformOrigin,
    shape: Shape,
    clip: Boolean,
    renderEffect: RenderEffect?,
    ambientShadowColor: Color,
    spotShadowColor: Color,
    compositingStrategy: CompositingStrategy
)

Modifier.Element 可讓內容繪製到繪圖圖層中。

範圍:任何

Modifier.Element 可新增繪圖圖層,讓工具能夠識別已繪製圖片中的元素。

鍵盤

範圍:任何
Modifier.onKeyEvent(onKeyEvent: (KeyEvent) -> Boolean)

在元件的 modifier 參數中加入這個 modifier,可讓該元件 (或其中一個子項) 在成為焦點時攔截硬體的按鍵事件。

範圍:任何
Modifier.onPreviewKeyEvent(onPreviewKeyEvent: (KeyEvent) -> Boolean)

在元件的 modifier 參數中加入這個 modifier,可讓該元件 (或其中一個子項) 在成為焦點時攔截硬體的按鍵事件。

版面配置

範圍:任何
Modifier.layoutId(layoutId: String, tag: String?)

替代 androidx.compose.ui.layout.layoutId,可用於啟用 tag

範圍:任何
Modifier.layoutId(layoutId: Any)

使用 layoutId 來標記元素,用來在其母項中識別元素。

範圍:任何

建立 LayoutModifier,允許變更包裝元素的測量及配置方式。

範圍:任何
Modifier.onGloballyPositioned(
    onGloballyPositioned: (LayoutCoordinates) -> Unit
)

當內容的全域位置可能已經變更時,使用元素的 LayoutCoordinates 來叫用 onGloballyPositioned

邊框間距

範圍:任何
Modifier.paddingFrom(alignmentLine: AlignmentLine, before: Dp, after: Dp)

Modifier 可加入邊框間距,根據其邊界到 alignment line 的指定距離來放置內容。

範圍:任何
Modifier.paddingFrom(
    alignmentLine: AlignmentLine,
    before: TextUnit,
    after: TextUnit
)

Modifier 可加入邊框間距,根據其邊界到 alignment line 的指定距離來放置內容。

範圍:任何
Modifier.paddingFromBaseline(top: Dp, bottom: Dp)

Modifier 可將內容放置在版面配置中,從版面配置頂端到 baseline of the first line of text in the content 的距離為 topbaseline of the last line of text in the content 到版面配置底部的距離為 bottom

範圍:任何

Modifier 可將內容放置在版面配置中,從版面配置頂端到 baseline of the first line of text in the content 的距離為 topbaseline of the last line of text in the content 到版面配置底部的距離為 bottom

範圍:任何
Modifier.absolutePadding(left: Dp, top: Dp, right: Dp, bottom: Dp)

Dp 內容的每邊增加額外的空間:lefttoprightbottom

範圍:任何

在內容的每邊緣 (左側、頂端、右側和底部) 加入 all dp 的額外空間。

範圍:任何
Modifier.padding(paddingValues: PaddingValues)

PaddingValues 套用至元件,做為內容左側、頂端、右側和底部邊緣的額外空間。

範圍:任何
Modifier.padding(horizontal: Dp, vertical: Dp)

在內容的左右邊緣加入 horizontal dp 空間,並在頂端和底部邊緣加入 vertical dp 空間。

範圍:任何
Modifier.padding(start: Dp, top: Dp, end: Dp, bottom: Dp)

Dp 內容的每邊增加額外的空間:starttopendbottom

範圍:任何

加上邊框間距以配合 caption bar 的插邊。

範圍:任何

加上邊框間距以容納 display cutout

範圍:任何

加上邊框間距以配合 ime 的插邊。

範圍:任何

加上邊框間距以配合 mandatory system gestures 的插邊。

範圍:任何

加上邊框間距以配合 navigation bars 的插邊。

範圍:任何

加上邊框間距以配合 safe content 的插邊。

範圍:任何

加上邊框間距以配合 safe gestures 的插邊。

範圍:任何

加上邊框間距以配合 status bars 的插邊。

範圍:任何

加上邊框間距以配合 system bars 的插邊。

範圍:任何

加上邊框間距以配合 system gestures 的插邊。

範圍:任何

加上邊框間距以配合 waterfall 的插邊。

範圍:任何

增加邊框間距,讓內容不會進入 insets 的空間。

指標

範圍:任何
Modifier.pointerHoverIcon(
    icon: PointerIcon,
    overrideDescendants: Boolean
)

修飾符可讓開發人員定義遊標懸停在元素上時顯示的指標圖示。

範圍:任何
Modifier.pointerInteropFilter(
    requestDisallowInterceptTouchEvent: RequestDisallowInterceptTouchEvent?,
    onTouchEvent: (MotionEvent) -> Boolean
)

這個特別的 PointerInputModifier 可用來存取原分派給 Compose 的基礎 MotionEvent

範圍:任何
Modifier. pointerInput(block: suspend PointerInputScope.() -> Unit)

此函式已淘汰不用。Modifier.pointerInput 必須提供一或多個定義修飾符身分的「key」參數,並判斷何時應取消其先前的輸入處理協同程式,並啟動新鍵的新效果。

範圍:任何

建立修飾符以便在已修改元素的區域內處理指標輸入。

範圍:任何
Modifier.pointerInput(vararg keys: Any?, block: PointerInputEventHandler)

建立修飾符以便在已修改元素的區域內處理指標輸入。

範圍:任何
Modifier.pointerInput(
    key1: Any?,
    key2: Any?,
    block: PointerInputEventHandler
)

建立修飾符以便在已修改元素的區域內處理指標輸入。

定位

範圍:任何

將內容位移 offset 個像素。

範圍:任何

將內容位移 (x dp, y dp)。

範圍:任何
Modifier.offset(offset: Density.() -> IntOffset)

將內容位移 offset 個像素。

範圍:任何
Modifier.offset(x: Dp, y: Dp)

將內容位移 (x dp, y dp)。

範圍: TabRowDefaults
Modifier.tabIndicatorOffset(currentTabPosition: TabPosition)

Modifier 會使用 TabRow 內所有可用的寬度,然後根據 currentTabPosition 而定,對要套用的指標進行動畫偏移。

範圍: TabRowDefaults
Modifier.tabIndicatorOffset(currentTabPosition: TabPosition)

Modifier 會使用 TabRow 內所有可用的寬度,然後根據 currentTabPosition 而定,對要套用的指標進行動畫偏移。

語意

範圍:任何

包含未確定進度指標所需的 semantics,代表正在執行作業的狀態。

範圍:任何
Modifier.progressSemantics(
    value: Float,
    valueRange: ClosedFloatingPointRange<Float>,
    steps: @IntRange(from = 0) Int
)

包含確定進度指標或滑桿的進度部分所需的 semantics,代表 valueRange 中的進度。

範圍:任何
Modifier.rangeSemantics(
    value: Float,
    enabled: Boolean,
    onValueChange: (Float) -> Unit,
    valueRange: ClosedFloatingPointRange<Float>,
    steps: Int
)

這個修飾符用於新增語意,表示 Stepper/Slider 的進度。

範圍:任何

清除所有子系節點的語意並設定新的語意。

範圍:任何
Modifier.semantics(mergeDescendants: Boolean, properties: SemanticsPropertyReceiver.() -> Unit)

對版面配置節點新增語意鍵/值組,以用於測試、無障礙功能等。

捲動

範圍:任何

剪輯主軸上可捲動的容器邊界,同時保留空間來顯示背景效果 (例如陰影)。

範圍:任何
Modifier.nestedScroll(
    connection: NestedScrollConnection,
    dispatcher: NestedScrollDispatcher?
)

修改元素讓其加入巢狀捲動階層。

範圍:任何
Modifier.overscroll(overscrollEffect: OverscrollEffect?)

顯示來自提供的 overscrollEffect 的過度捲動。

範圍:任何
Modifier.onPreRotaryScrollEvent(
    onPreRotaryScrollEvent: (RotaryScrollEvent) -> Boolean
)

在元件的 modifier 參數中加入這個 modifier,即可在元件 (或其中一個子項) 成為焦點時攔截 RotaryScrollEvent

範圍:任何
Modifier.onRotaryScrollEvent(
    onRotaryScrollEvent: (RotaryScrollEvent) -> Boolean
)

在元件的 modifier 參數中加入這個 modifier,即可在元件 (或其中一個子項) 成為焦點時攔截 RotaryScrollEvent

範圍:任何
Modifier.rotaryScrollable(
    behavior: RotaryScrollableBehavior,
    focusRequester: FocusRequester,
    reverseDirection: Boolean
)

該修飾符連結旋轉事件與可捲動的容器,例如 Column、LazyList 等。

範圍:任何
Modifier.scrollAway(
    scrollInfoProvider: ScrollInfoProvider,
    screenStage: () -> ScreenStage
)

根據捲動清單提供的捲動狀態,將項目垂直移入/移出檢視畫面。

範圍:任何
Modifier.scrollAway(scrollState: ScrollState, offset: Dp)

根據 ScrollState 以垂直方式將項目捲動進出檢視畫面。

範圍:任何
Modifier.scrollAway(
    scrollState: LazyListState,
    itemIndex: Int,
    offset: Dp
)

根據 LazyListState 以垂直方式將項目捲動進出檢視畫面。

範圍:任何
Modifier.scrollAway(
    scrollState: ScalingLazyListState,
    itemIndex: Int,
    offset: Dp
)

根據 ScalingLazyListState 以垂直方式將項目捲動進出檢視畫面。

範圍:任何
Modifier. scrollAway(
    scrollState: ScalingLazyListState,
    itemIndex: Int,
    offset: Dp
)

此函式已淘汰不用。這個超載是為了提供與 Compose for Wear OS 1.1 回溯相容而提供。較新的超載,可使用 wear.compose.foundation.lazy 套件的 ScalingLazyListState

範圍:任何
Modifier.horizontalScroll(
    state: ScrollState,
    enabled: Boolean,
    flingBehavior: FlingBehavior?,
    reverseScrolling: Boolean
)

修改元素,讓內容寬度大於允許的上限時,能夠水平捲動。

範圍:任何
Modifier.horizontalScroll(
    state: ScrollState,
    overscrollEffect: OverscrollEffect?,
    enabled: Boolean,
    flingBehavior: FlingBehavior?,
    reverseScrolling: Boolean
)

修改元素,讓內容寬度大於允許的上限時,能夠水平捲動。

範圍:任何
Modifier.verticalScroll(
    state: ScrollState,
    enabled: Boolean,
    flingBehavior: FlingBehavior?,
    reverseScrolling: Boolean
)

修改元素,當內容的高度大於可用的上限條件時允許進行垂直捲動。

範圍:任何
Modifier.verticalScroll(
    state: ScrollState,
    overscrollEffect: OverscrollEffect?,
    enabled: Boolean,
    flingBehavior: FlingBehavior?,
    reverseScrolling: Boolean
)

修改元素,當內容的高度大於可用的上限條件時允許進行垂直捲動。

範圍:任何

此修飾符可為 TransformingLazyColumn 項目中的內容啟用 Material3 Motion 轉換作業。

範圍:任何
@Composable
Modifier.scrollTransform(
    scope: TransformingLazyColumnItemScope,
    backgroundColor: Color,
    shape: Shape
)

此修飾符可為 TransformingLazyColumn 項目中的內容啟用 Material3 Motion 轉換作業。

範圍:任何
@Composable
Modifier.scrollTransform(
    scope: TransformingLazyColumnItemScope,
    shape: Shape,
    painter: Painter,
    border: BorderStroke?
)

此修飾符可為 TransformingLazyColumn 項目中的內容啟用 Material3 Motion 轉換作業。

範圍:任何
Modifier.scrollable(
    state: ScrollableState,
    orientation: Orientation,
    enabled: Boolean,
    reverseDirection: Boolean,
    flingBehavior: FlingBehavior?,
    interactionSource: MutableInteractionSource?
)

為單一 Orientation 中的 UI 元素設定觸控捲動和快速滑過功能。

範圍:任何
Modifier.scrollable(
    state: ScrollableState,
    orientation: Orientation,
    overscrollEffect: OverscrollEffect?,
    enabled: Boolean,
    reverseDirection: Boolean,
    flingBehavior: FlingBehavior?,
    interactionSource: MutableInteractionSource?,
    bringIntoViewSpec: BringIntoViewSpec?
)

為單一 Orientation 中的 UI 元素設定觸控捲動和快速滑過功能。

範圍:任何

在 Android R 以上版本將軟式鍵盤設為巢狀捲動功能。

大小

範圍:任何
Modifier.animateContentSize(
    animationSpec: FiniteAnimationSpec<IntSize>,
    finishedListener: ((initialValue: IntSize, targetValue: IntSize) -> Unit)?
)

當其子項修飾符 (如果已位於鏈結的尾部,則為子項可組合函式) 變更大小時,此修飾符會為自身大小建立動畫效果。

範圍:任何
Modifier.animateContentSize(
    animationSpec: FiniteAnimationSpec<IntSize>,
    alignment: Alignment,
    finishedListener: ((initialValue: IntSize, targetValue: IntSize) -> Unit)?
)

當其子項修飾符 (如果已位於鏈結的尾部,則為子項可組合函式) 變更大小時,此修飾符會為自身大小建立動畫效果。

範圍:任何
Modifier.aspectRatio(
    ratio: @FloatRange(from = 0.0, fromInclusive = false) Float,
    matchHeightConstraintsFirst: Boolean
)

嘗試按照以下順序匹配傳入的約束之一,以調整內容大小,使其符合指定的寬高比:Constraints.maxWidthConstraints.maxHeightConstraints.minWidthConstraints.minHeight如果matchHeightConstraintsFirstfalse(這是預設值),或者Constraints.maxHeightConstraints.maxWidthConstraints.minHeightConstraints.minWidth如果matchHeightConstraintsFirsttrue

範圍:任何

保留至少 48.dp 的大小,以便在元素測量出較小尺寸時,清楚區分觸控互動。

範圍:任何

保留至少 48.dp 的大小,以便在元素測量出較小尺寸時,清楚區分觸控互動。

範圍:任何

保留至少 48.dp 的大小,以便在元素測量出較小尺寸時,清楚區分觸控互動。

範圍:任何

保留至少 48.dp 的大小,以便在元素測量出較小尺寸時,清楚區分觸控互動。

範圍:任何
Modifier.height(intrinsicSize: IntrinsicSize)

將內容的偏好高度宣告為和內容的最小或最大內建高度相同。

範圍:任何

將內容的高度宣告為和內容最小或最大內建高度完全相同。

範圍:任何

將內容的寬度宣告為和內容的最小或最大內建寬度完全相同。

範圍:任何
Modifier.width(intrinsicSize: IntrinsicSize)

將內容的偏好寬度宣告為和內容的最小或最大內建寬度相同。

範圍:任何
Modifier.onSizeChanged(onSizeChanged: (IntSize) -> Unit)

在首次測量元素或元素大小變更時,使用已修改的 Compose UI 元素來叫用。

範圍:任何
Modifier.defaultMinSize(minWidth: Dp, minHeight: Dp)

只有在已包裝版面配置不受限制的情況下才限制已包裝版面配置的大小:只有在傳入的對應限制為 0 時,才會套用 minWidthminHeight 限制條件。

範圍:任何
Modifier.fillMaxHeight(fraction: @FloatRange(from = 0.0, to = 1.0) Float)

透過將 minimum heightmaximum height 設定為等於 maximum height 乘以 fraction,將內容填滿 (可能只有部分) 傳入大小限制的 Constraints.maxHeight

範圍:任何
Modifier.fillMaxSize(fraction: @FloatRange(from = 0.0, to = 1.0) Float)

minimum widthmaximum width 設定為等於 maximum width 乘以 fraction,並將 minimum heightmaximum height 設定為等於 maximum height 乘以 fraction,讓內容填入(可能僅部分填滿)傳入測量約束的 Constraints.maxWidthConstraints.maxHeight

範圍:任何
Modifier.fillMaxWidth(fraction: @FloatRange(from = 0.0, to = 1.0) Float)

透過將 minimum widthmaximum width 設定為等於 maximum width 乘以 fraction,將內容填滿 (可能只有部分) 傳入大小限制的 Constraints.maxWidth

範圍:任何
Modifier.height(height: Dp)

將內容的偏好高度宣告為精準為 heightdp。

範圍:任何
Modifier.heightIn(min: Dp, max: Dp)

依據傳入大小 Constraints 的許可,將內容的高度限制在 mindp 到 maxdp 之間。

範圍:任何

將內容的高度宣告為精準等於 heightdp。

範圍:任何
Modifier.requiredHeightIn(min: Dp, max: Dp)

將內容的高度限制在 mindp 到 maxdp 之間。

範圍:任何

將內容的寬度和高度宣告為精準等於 sizedp。

範圍:任何

宣告內容的大小必須完全符合 size

範圍:任何
Modifier.requiredSize(width: Dp, height: Dp)

將內容的大小宣告為精準等於 widthdp 和 heightdp。

範圍:任何
Modifier.requiredSizeIn(
    minWidth: Dp,
    minHeight: Dp,
    maxWidth: Dp,
    maxHeight: Dp
)

將內容的寬度限制在 minWidthdp 到 maxWidthdp 之間,高度限制在 minHeightdp 與 maxHeightdp 之間。

範圍:任何

將內容的寬度宣告為精準等於 widthdp。

範圍:任何
Modifier.requiredWidthIn(min: Dp, max: Dp)

將內容的寬度限制在 mindp 到 maxdp 之間。

範圍:任何
Modifier.size(size: Dp)

將內容的偏好大小宣告為精準等於 sizedp 的正方形。

範圍:任何
Modifier.size(size: DpSize)

宣告內容的偏好大小必須完全符合 size

範圍:任何
Modifier.size(width: Dp, height: Dp)

將內容的偏好大小宣告為精準等於 widthdp x heightdp。

範圍:任何
Modifier.sizeIn(minWidth: Dp, minHeight: Dp, maxWidth: Dp, maxHeight: Dp)

依據傳入大小 Constraints 的限制,將內容的寬度限制在 minWidthdp 到 maxWidthdp 之間,高度則限制在 minHeightdp 到 maxHeightdp 之間。

範圍:任何
Modifier.width(width: Dp)

將內容的偏好寬度宣告為精準為 widthdp。

範圍:任何
Modifier.widthIn(min: Dp, max: Dp)

依據傳入大小 Constraints 的許可,將內容的寬度限制在 mindp 到 maxdp 之間。

範圍:任何
Modifier.wrapContentHeight(
    align: Alignment.Vertical,
    unbounded: Boolean
)

允許內容根據本身所要的高度進行測量,而無需考慮傳入的測量 minimum height constraint;若 unbounded 為 true,則也無需考慮傳入的測量 maximum height constraint

範圍:任何
Modifier.wrapContentSize(align: Alignment, unbounded: Boolean)

允許內容根據本身所要的大小進行測量,而無需考慮傳入的測量 minimum widthminimum height 限制;如果 unbounded 為 true,則也無需考慮傳入的最大限制。

範圍:任何
Modifier.wrapContentWidth(
    align: Alignment.Horizontal,
    unbounded: Boolean
)

允許內容根據本身所要的寬度進行測量,而無需考慮傳入的測量 minimum width constraint;若 unbounded 為 true,則也無需考慮傳入的測量 maximum width constraint

範圍:任何

此修飾符會在變形轉換期間將目標可組合函式的高度提供給 scrollTransform,表示在變形時代表項目的最小高度。

範圍:任何

用於設定 IconButton 和 TextButton 大小和建議的觸控目標的修飾符。

範圍:任何

將高度設為等於位於螢幕 bottominsets

範圍:任何

LayoutDirection 而定,使用 leftright 將寬度設為等於位於螢幕 endinsets

範圍:任何

LayoutDirection 而定,使用 leftright 將寬度設為等於位於螢幕 startinsets

範圍:任何

將高度設為等同於位於螢幕 topinsets

範圍: RowScope
Modifier.weight(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float,
    fill: Boolean
)

根據 Row 中其他加權同層級元素的 weight,調整元素的寬度。

範圍: ColumnScope
Modifier.weight(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float,
    fill: Boolean
)

根據 Column 中其他加權同層級元素的 weight,調整元素的高度。

範圍: FlowRowScope
@ExperimentalLayoutApi
Modifier.fillMaxRowHeight(fraction: @FloatRange(from = 0.0, to = 1.0) Float)

FlowRow 內,將項目填滿 (可能只有部分) 其中最高項目高度上限。

範圍: FlowColumnScope
@ExperimentalLayoutApi
Modifier.fillMaxColumnWidth(
    fraction: @FloatRange(from = 0.0, to = 1.0) Float
)

將項目填滿 (可能只有部分) 加入其所在資料欄中最寬的項目寬度上限 (位於 FlowColumn 中)。

範圍: BoxScope

在完成測量所有其他內容元素後,調整元素大小以符合 Box 的大小。

範圍: LazyItemScope
Modifier.fillParentMaxHeight(
    fraction: @FloatRange(from = 0.0, to = 1.0) Float
)

透過將 minimum height 設定為等於 maximum height 乘以 fraction,讓內容填滿傳入測量限制的 Constraints.maxHeight

範圍: LazyItemScope
Modifier.fillParentMaxSize(
    fraction: @FloatRange(from = 0.0, to = 1.0) Float
)

透過將 minimum width 設定為等於 maximum width 乘以 fraction,並將 minimum height 設定為等於 maximum height 乘以 fraction,讓內容填滿父項大小限制的 Constraints.maxWidthConstraints.maxHeight

範圍: LazyItemScope
Modifier.fillParentMaxWidth(
    fraction: @FloatRange(from = 0.0, to = 1.0) Float
)

透過將 minimum width 設定為等於 maximum width 乘以 fraction,讓內容填滿父項尺寸限制的 Constraints.maxWidth

abstract
Modifier.exposedDropdownSize(matchTextFieldWidth: Boolean)

該修飾符應套用至範圍內部的 ExposedDropdownMenu

abstract
Modifier.exposedDropdownSize(matchAnchorWidth: Boolean)

修飾符應套用至 ExposedDropdownMenuBoxScope 內部的選單。

此修飾符會指定窗格的偏好寬度,而在關聯窗格算繪為固定窗格 (例如,未延伸以填滿剩餘空間的窗格) 時,窗格 scaffold 實作會盡量依循這個寬度。

測試

範圍:任何

套用標記,允許在測試中找到修改的元素。

轉換

範圍:任何
Modifier.rotate(degrees: Float)

設定檢視畫面沿著可組合函式中心旋轉的角度。

範圍:任何
Modifier.scale(scale: Float)

依據相同的縮放比例係數,均勻縮放水平軸和垂直軸的內容。

範圍:任何
Modifier.scale(scaleX: Float, scaleY: Float)

按照下列縮放比例係數,分別沿著水平軸和垂直軸縮放可組合項的內容。

範圍:任何
Modifier.transformable(
    state: TransformableState,
    lockRotationOnZoomPan: Boolean,
    enabled: Boolean
)

為已修改的 UI 元素啟用轉換手勢。

範圍:任何
Modifier.transformable(
    state: TransformableState,
    canPan: (Offset) -> Boolean,
    lockRotationOnZoomPan: Boolean,
    enabled: Boolean
)

為已修改的 UI 元素啟用轉換手勢。

其他

範圍:任何

此函式已淘汰不用。已由超載取代為取得轉移資料的回呼,並由 Compose 執行開始偵測

範圍:任何
Modifier.basicMarquee(
    iterations: Int,
    animationMode: MarqueeAnimationMode,
    repeatDelayMillis: Int,
    initialDelayMillis: Int,
    spacing: MarqueeSpacing,
    velocity: Dp
)

如果修改後的內容寬度超出可用空間,就會以動畫跑馬燈效果套用動畫效果。

範圍:任何
Modifier.edgeSwipeToDismiss(
    swipeToDismissBoxState: SwipeToDismissBoxState,
    edgeWidth: Dp
)

限制只可在可視區域邊緣使用滑動關閉。

範圍:任何
Modifier.blur(radius: Dp, edgeTreatment: BlurredEdgeTreatment)

依指定的半徑對內容進行模糊處理。

範圍:任何
Modifier.blur(
    radiusX: Dp,
    radiusY: Dp,
    edgeTreatment: BlurredEdgeTreatment
)

依指定的半徑對內容進行模糊處理。

範圍:任何
Modifier.bringIntoViewRequester(
    bringIntoViewRequester: BringIntoViewRequester
)

可用來傳送 bringIntoView 要求的修飾符。

範圍:任何

此函式已淘汰不用。請改用 BringIntoViewModifierNode

範圍:任何
Modifier.composed(
    inspectorInfo: InspectorInfo.() -> Unit,
    factory: @Composable Modifier.() -> Modifier
)

宣告 Modifier 的及時組合,由其修改的每個元素組成。

範圍:任何
Modifier.composed(
    fullyQualifiedName: String,
    key1: Any?,
    inspectorInfo: InspectorInfo.() -> Unit,
    factory: @Composable Modifier.() -> Modifier
)

宣告 Modifier 的及時組合,由其修改的每個元素組成。

範圍:任何
Modifier.composed(
    fullyQualifiedName: String,
    vararg keys: Any?,
    inspectorInfo: InspectorInfo.() -> Unit,
    factory: @Composable Modifier.() -> Modifier
)

宣告 Modifier 的及時組合,由其修改的每個元素組成。

範圍:任何
Modifier.composed(
    fullyQualifiedName: String,
    key1: Any?,
    key2: Any?,
    inspectorInfo: InspectorInfo.() -> Unit,
    factory: @Composable Modifier.() -> Modifier
)

宣告 Modifier 的及時組合,由其修改的每個元素組成。

範圍:任何
Modifier.composed(
    fullyQualifiedName: String,
    key1: Any?,
    key2: Any?,
    key3: Any?,
    inspectorInfo: InspectorInfo.() -> Unit,
    factory: @Composable Modifier.() -> Modifier
)

宣告 Modifier 的及時組合,由其修改的每個元素組成。

範圍:任何
Modifier.dragAndDropSource(
    transferData: (Offset) -> DragAndDropTransferData?
)

可讓所套用元素將其視為拖曳作業的來源的 Modifier

範圍:任何
@ExperimentalFoundationApi
Modifier. dragAndDropSource(
    drawDragDecoration: DrawScope.() -> Unit,
    block: suspend DragAndDropSourceScope.() -> Unit
)

此函式已淘汰不用。已由超載取代為取得轉移資料的回呼,並由 Compose 執行開始偵測

範圍:任何
Modifier.dragAndDropSource(
    drawDragDecoration: DrawScope.() -> Unit,
    transferData: (Offset) -> DragAndDropTransferData?
)

可讓所套用元素將其視為拖曳作業的來源的 Modifier

範圍:任何
Modifier.dragAndDropTarget(
    shouldStartDragAndDrop: (startEvent: DragAndDropEvent) -> Boolean,
    target: DragAndDropTarget
)

可接收拖曳手勢的修飾符。

範圍:任何

此函式已淘汰不用。使用 systemGestureExclusion

範圍:任何

此函式已淘汰不用。使用 systemGestureExclusion

範圍:任何
Modifier.handwritingDetector(callback: () -> Unit)

將元素設為手寫偵測工具,偵測觸控筆手寫內容,並委派對其他元素處理已辨識的文字。

範圍:任何

將元素設為觸控筆手寫處理常式,處理因觸控筆手寫偵測工具而使用觸控筆手寫工作階段所觸發的文字輸入內容。

範圍:任何
Modifier.hoverable(
    interactionSource: MutableInteractionSource,
    enabled: Boolean
)

將元件設為可透過游標進入/離開事件懸停。

範圍:任何
inline
Modifier. inspectable(
    noinline inspectorInfo: InspectorInfo.() -> Unit,
    factory: Modifier.() -> Modifier
)

此函式已淘汰不用。此 API 會建立超過必要性的修飾符撤銷,因此不建議使用。

範圍:任何
Modifier.approachLayout(
    isMeasurementApproachInProgress: (lookaheadSize: IntSize) -> Boolean,
    isPlacementApproachInProgress: Placeable.PlacementScope.(lookaheadCoordinates: LayoutCoordinates) -> Boolean,
    approachMeasure: ApproachMeasureScope.(measurable: Measurable, constraints: Constraints) -> MeasureResult
)

建立方法版面配置,協助逐步完成 Lookahead 流程中計算出的目的地版面配置。

範圍:任何
Modifier.magnifier(
    sourceCenter: Density.() -> Offset,
    magnifierCenter: (Density.() -> Offset)?,
    onSizeChanged: ((DpSize) -> Unit)?,
    zoom: Float,
    size: DpSize,
    cornerRadius: Dp,
    elevation: Dp,
    clip: Boolean
)

顯示 Magnifier 小工具,該工具會在 sourceCenter 顯示與目前版面配置節點相比的大尺寸內容。

範圍:任何

這個修飾符可以用來使用由其左側的其他修飾符、或版面配置樹狀結構中位於這個修飾符上方所提供的 ModifierLocal

範圍:任何
<T : Any?> Modifier.modifierLocalProvider(
    key: ProvidableModifierLocal<T>,
    value: () -> T
)

這個修飾符可用來提供 ModifierLocal,可供此修飾符右側的其他修飾符、或是此修飾符在版面配置節點子項中所附加的修飾符讀取。

範圍:任何
Modifier.onLayoutRectChanged(
    throttleMillis: Long,
    debounceMillis: Long,
    callback: (RelativeLayoutBounds) -> Unit
)

利用這個版面配置節點的位置 (相對於組合根的座標系統),以及螢幕座標和視窗座標,叫用 callback

範圍:任何

在父項 LayoutModifier 和上層版面配置之後和放置子項 LayoutModifier 之前,叫用 onPlaced

範圍:任何
@ExperimentalWearMaterialApi
@Composable
Modifier.placeholder(
    placeholderState: PlaceholderState,
    shape: Shape,
    color: Color
)

可在可組合項頂端繪製預留位置形狀,並為抹除效果加入動畫效果,藉此移除預留位置。

範圍:任何
@Composable
Modifier.placeholder(
    placeholderState: PlaceholderState,
    shape: Shape,
    color: Color
)

可在可組合項頂端繪製預留位置形狀,並為抹除效果加入動畫效果,藉此移除預留位置。

範圍:任何
@ExperimentalWearMaterialApi
@Composable
Modifier.placeholderShimmer(
    placeholderState: PlaceholderState,
    shape: Shape,
    color: Color
)

此修飾符可在元件上繪製閃光預留位置。

範圍:任何
@Composable
Modifier.placeholderShimmer(
    placeholderState: PlaceholderState,
    shape: Shape,
    color: Color
)

此修飾符可在元件上繪製閃光預留位置。

範圍:任何
Modifier.stylusHoverIcon(
    icon: PointerIcon,
    overrideDescendants: Boolean,
    touchBoundsExpansion: DpTouchBoundsExpansion?
)

修飾符可讓開發人員定義觸控筆懸停在元素上時顯示的指標圖示。

範圍:任何
Modifier.motionEventSpy(watcher: (motionEvent: MotionEvent) -> Unit)

針對版面配置區域或任何子項 pointerInput 接收到的每個 MotionEvent 呼叫 watcher

範圍:任何

將版面配置矩形標示為偏好固定浮動視窗。

範圍:任何

在本機版面配置座標中標示矩形,且偏好保持不透明的浮動視窗。

範圍:任何

該修飾符用於根據指定的 PullRefreshState,來平移位置並縮放下拉即可重新整理指標的大小。

範圍:任何

state 提供捲動事件的巢狀捲動修飾符。

範圍:任何
@ExperimentalMaterialApi
Modifier.pullRefresh(
    onPull: (pullDelta: Float) -> Float,
    onRelease: suspend (flingVelocity: Float) -> Float,
    enabled: Boolean
)

巢狀捲動修飾符,提供 onPullonRelease 回呼,協助建構自訂提取重新整理元件。

範圍:任何
@ExperimentalMaterial3Api
Modifier.pullToRefresh(
    isRefreshing: Boolean,
    state: PullToRefreshState,
    enabled: Boolean,
    threshold: Dp,
    onRefresh: () -> Unit
)

該修飾符可將巢狀捲動新增至容器,以支援下拉即可重新整理手勢。

範圍:任何

將目前節點和任何子節點設為內容接收端。

範圍:任何
Modifier.sensitiveContent(isContentSensitive: Boolean)

這個修飾符會提示可組合函式在螢幕上轉譯機密內容 (例如使用者名稱、密碼、信用卡等),而內容在支援的環境分享期間應受到保護。

範圍:任何
Modifier.onInterceptKeyBeforeSoftKeyboard(
    onInterceptKeyBeforeSoftKeyboard: (KeyEvent) -> Boolean
)

將此 modifier 新增至元件的 modifier 參數後,該元件可在傳送至螢幕鍵盤前攔截硬體的按鍵事件。

範圍:任何
Modifier.onPreInterceptKeyBeforeSoftKeyboard(
    onPreInterceptKeyBeforeSoftKeyboard: (KeyEvent) -> Boolean
)

將此 modifier 新增至元件的 modifier 參數後,該元件可在傳送至螢幕鍵盤前攔截硬體的按鍵事件。

範圍:任何
Modifier. edgeSwipeToDismiss(
    swipeToDismissBoxState: SwipeToDismissBoxState,
    edgeWidth: Dp
)

此函式已淘汰不用。滑動至 androidx.wear.compose.foundation

範圍:任何

從系統手勢中排除版面配置的矩形。

範圍:任何

從系統手勢中排除本機版面配置座標內的矩形。

範圍:任何

使用未被其他插邊修飾符取用的插邊,類似於未加上任何邊框間距的 windowInsetsPadding

範圍:任何

paddingValues 視為插邊使用,如同與插邊無關一般加入編框間距。

範圍:任何
Modifier.onConsumedWindowInsetsChanged(
    block: (consumedWindowInsets: WindowInsets) -> Unit
)

透過 consumeWindowInsets 或其中一個邊框間距修飾符 (例如 imePadding),透過已使用的 WindowInsets 來呼叫 block

範圍:任何

這會根據大小和位置重新計算 WindowInsets

此函式已淘汰不用。使用採用 ExposedDropdownMenuAnchorType 和已啟用參數的超載

abstract
Modifier.menuAnchor(
    type: ExposedDropdownMenuAnchorType,
    enabled: Boolean
)

該修飾符應套用至 ExposedDropdownMenuBoxScope 內的元素,通常是文字欄位或文字欄位中的圖示。