鴻蒙OS TableLayout.LayoutConfig

2022-09-30 17:58 更新

TableLayout.LayoutConfig

java.lang.Object

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

|---|---ohos.agp.components.TableLayout.LayoutConfig

public static class TableLayout.LayoutConfig
extends ComponentContainer.LayoutConfig

提供表格布局所需的布局配置。

表格布局配置集成了 ComponentContainer.LayoutConfig 并提供了 TableLayout.Specification。 前者表示組件容器中的邊距布局配置,后者表示行和列規(guī)范。

Since:

3

字段摘要

修飾符和類型 字段 描述
TableLayout.Specification columnSpec 指示表格布局中的列規(guī)范。
TableLayout.Specification rowSpec 指示表格布局中的行規(guī)范。
從類 ohos.agp.components.ComponentContainer.LayoutConfig 繼承的字段
height, MATCH_CONTENT, MATCH_PARENT, width

構造函數(shù)摘要

構造函數(shù) 描述
LayoutConfig() 用于創(chuàng)建 LayoutConfig 實例的默認構造函數(shù)。
LayoutConfig(int width, int height) 用于指定表格布局的寬度和高度的構造函數(shù)。
LayoutConfig(ComponentContainer.LayoutConfig params) 用于復制 ComponentContainer.LayoutConfig 實例的構造函數(shù)。
LayoutConfig(TableLayout.LayoutConfig source) 用于復制 LayoutConfig 實例的行和列規(guī)范的構造函數(shù)。
LayoutConfig(TableLayout.Specification rowSpec, TableLayout.Specification columnSpec) 用于在表格布局中創(chuàng)建行和列規(guī)范的構造函數(shù)。
LayoutConfig(Context context, AttrSet attrSet) 用于根據上下文和屬性集創(chuàng)建 LayoutConfig 實例的構造函數(shù)。

方法總結

從類 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
從類 java.lang.Object 繼承的方法
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

字段詳細信息

columnSpec

public TableLayout.Specification columnSpec

指示表格布局中的列規(guī)范。

Since:

1

rowSpec

public TableLayout.Specification rowSpec

指示表格布局中的行規(guī)范。

Since:

1

構造函數(shù)詳細信息

LayoutConfig

public LayoutConfig()

用于創(chuàng)建 LayoutConfig 實例的默認構造函數(shù)。

Since:

3

LayoutConfig

public LayoutConfig(Context context, AttrSet attrSet)

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

參數(shù):

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

Since:

3

LayoutConfig

public LayoutConfig(TableLayout.Specification rowSpec, TableLayout.Specification columnSpec)

用于在表格布局中創(chuàng)建行和列規(guī)范的構造函數(shù)。

參數(shù):

參數(shù)名稱 參數(shù)描述
rowSpec 指示表格布局中的行規(guī)范。
columnSpec 指示表格布局中的列規(guī)范。

Since:

3

LayoutConfig

public LayoutConfig(int width, int height)

用于指定表格布局的寬度和高度的構造函數(shù)。

參數(shù):

參數(shù)名稱 參數(shù)描述
width 表示表格布局的寬度,不能小于0。
height 表示表格布局的高度,不能小于0。

Since:

3

LayoutConfig

public LayoutConfig(TableLayout.LayoutConfig source)

用于復制 LayoutConfig 實例的行和列規(guī)范的構造函數(shù)。

參數(shù):

參數(shù)名稱 參數(shù)描述
source 指示要復制的表格布局。

Since:

3

LayoutConfig

public LayoutConfig(ComponentContainer.LayoutConfig params)

用于復制 ComponentContainer.LayoutConfig 實例的構造函數(shù)。

該方法調用父類ComponentContainer中同名的方法。

參數(shù):

參數(shù)名稱 參數(shù)描述
params 指示要復制的布局參數(shù)。

Since:

3

以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號