鴻蒙OS StackLayout.LayoutConfig

2022-09-30 11:55 更新

StackLayout.LayoutConfig

java.lang.Object

|---ohos.agp.components.ComponentContainer.LayoutConfig

|---|---ohos.agp.components.StackLayout.LayoutConfig

public static class StackLayout.LayoutConfig
extends ComponentContainer.LayoutConfig

配置 StackLayout 的布局參數(shù),包括寬度、高度和頁(yè)邊距。

Since:

3

字段摘要

修飾符和類(lèi)型 字段 描述
int alignment 指示控件的對(duì)齊值。
static int UNSPECIFIED_ALIGNMENT 表示尚未設(shè)置的對(duì)齊值。
從類(lèi) ohos.agp.components.ComponentContainer.LayoutConfig 繼承的字段
height, MATCH_CONTENT, MATCH_PARENT, width

構(gòu)造函數(shù)摘要

構(gòu)造函數(shù) 描述
LayoutConfig() 默認(rèn)構(gòu)造函數(shù),將默認(rèn)寬度和高度設(shè)置為 MATCH_CONTENT。
LayoutConfig(int width, int height) 用于設(shè)置布局的寬度和高度參數(shù)的構(gòu)造函數(shù)。
LayoutConfig(int width, int height, int alignment) 用于設(shè)置布局的寬度、高度和對(duì)齊參數(shù)的構(gòu)造函數(shù)。
LayoutConfig(ComponentContainer.LayoutConfig source) 用于根據(jù)源布局的寬度、高度和邊距設(shè)置布局參數(shù)的構(gòu)造函數(shù)。
LayoutConfig(StackLayout.LayoutConfig source) 用于根據(jù)源布局的寬度、高度、邊距和對(duì)齊方式設(shè)置布局參數(shù)的構(gòu)造函數(shù)。
LayoutConfig(Context context, AttrSet attrSet) 用于根據(jù)上下文和屬性集創(chuàng)建 LayoutConfig 實(shí)例的構(gòu)造函數(shù)。

方法總結(jié)

從類(lèi) ohos.agp.components.ComponentContainer.LayoutConfig 繼承的方法
clone, getHorizontalEndMargin, getHorizontalStartMargin, getLayoutDirection, getMarginBottom, getMarginLeft, getMarginRight, getMargins, getMarginsLeftAndRight, getMarginsTopAndBottom, getMarginTop, isMarginsRelative, setMarginBottom, setMarginLeft, setMarginRight, setMargins, setMarginsLeftAndRight, setMarginsRelative, setMarginsTopAndBottom, setMarginTop
從類(lèi) java.lang.Object 繼承的方法
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

字段詳細(xì)信息

UNSPECIFIED_ALIGNMENT

public static final int UNSPECIFIED_ALIGNMENT

表示尚未設(shè)置的對(duì)齊值。

alignment

public int alignment

指示控件的對(duì)齊值。

構(gòu)造函數(shù)詳細(xì)信息

LayoutConfig

public LayoutConfig()

默認(rèn)構(gòu)造函數(shù),將默認(rèn)寬度和高度設(shè)置為 MATCH_CONTENT。

Since:

3

LayoutConfig

public LayoutConfig(Context context, AttrSet attrSet)

用于根據(jù)上下文和屬性集創(chuàng)建 LayoutConfig 實(shí)例的構(gòu)造函數(shù)。

參數(shù):

參數(shù)名稱(chēng) 參數(shù)描述
context 指示應(yīng)用程序上下文。
attrSet 指示要使用的屬性集。

Since:

3

LayoutConfig

public LayoutConfig(int width, int height)

用于設(shè)置布局的寬度和高度參數(shù)的構(gòu)造函數(shù)。

參數(shù):

參數(shù)名稱(chēng) 參數(shù)描述
width 指定寬度,可以是特定值,也可以是 ComponentContainer.LayoutConfig.MATCH_PARENT 或 ComponentContainer.LayoutConfig.MATCH_CONTENT。
height 指定高度,可以是特定值,也可以是 ComponentContainer.LayoutConfig.MATCH_PARENT 或 ComponentContainer.LayoutConfig.MATCH_CONTENT。

Since:

3

LayoutConfig

public LayoutConfig(int width, int height, int alignment)

用于設(shè)置布局的寬度、高度和對(duì)齊參數(shù)的構(gòu)造函數(shù)。

參數(shù):

參數(shù)名稱(chēng) 參數(shù)描述
width 指定寬度,可以是特定值,也可以是 ComponentContainer.LayoutConfig.MATCH_PARENT 或 ComponentContainer.LayoutConfig.MATCH_CONTENT。
height 指定高度,可以是特定值,也可以是 ComponentContainer.LayoutConfig.MATCH_PARENT 或 ComponentContainer.LayoutConfig.MATCH_CONTENT。
alignment 指定對(duì)齊值。

Since:

3

LayoutConfig

public LayoutConfig(StackLayout.LayoutConfig source)

用于根據(jù)源布局的寬度、高度、邊距和對(duì)齊方式設(shè)置布局參數(shù)的構(gòu)造函數(shù)。

參數(shù):

參數(shù)名稱(chēng) 參數(shù)描述
source 指定源布局的參數(shù)。

Since:

3

LayoutConfig

public LayoutConfig(ComponentContainer.LayoutConfig source)

用于根據(jù)源布局的寬度、高度和邊距設(shè)置布局參數(shù)的構(gòu)造函數(shù)。

參數(shù):

參數(shù)名稱(chēng) 參數(shù)描述
source 指定源布局的參數(shù)。

Since:

3

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)