鴻蒙OS TextAlignment

2022-11-02 10:07 更新

TextAlignment

java.lang.Object

|---ohos.agp.utils.TextAlignment

public class TextAlignment
extends Object

設(shè)置文本組件使用的對(duì)齊模式以與其父組件對(duì)齊。

此類設(shè)置文本組件如何在按鈕和布局等容器中對(duì)齊。 對(duì)齊方式包括左對(duì)齊、右對(duì)齊、水平居中對(duì)齊、垂直居中對(duì)齊、居中對(duì)齊、頂部對(duì)齊、底部對(duì)齊、開始對(duì)齊和結(jié)束對(duì)齊。

Since:

1

字段摘要

修飾符和類型 字段 描述
static int BOTTOM 表示底部對(duì)齊。
static int CENTER 表示中心對(duì)齊。
static int END 表示文本與容器的末端對(duì)齊。
static int HORIZONTAL_CENTER 表示水平居中對(duì)齊。
static int LEFT 表示左對(duì)齊。
static int RIGHT 表示右對(duì)齊。
static int START 表示文本與容器的開頭對(duì)齊。
static int TOP 表示頂部對(duì)齊。
static int VERTICAL_CENTER 表示垂直居中對(duì)齊。

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

構(gòu)造函數(shù) 描述
TextAlignment()

方法總結(jié)

從類 java.lang.Object 繼承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

字段詳細(xì)信息

BOTTOM

public static final int BOTTOM

表示底部對(duì)齊。

此常量表示文本與容器的底部邊緣對(duì)齊。

CENTER

public static final int CENTER

表示中心對(duì)齊。

此常量表示文本與容器的中心對(duì)齊。

END

public static final int END

表示文本與容器的末端對(duì)齊。

Since:

3

HORIZONTAL_CENTER

public static final int HORIZONTAL_CENTER

表示水平居中對(duì)齊。

此常量表示文本在容器中水平居中。

LEFT

public static final int LEFT

表示左對(duì)齊。

此常量指示文本與容器的左邊緣對(duì)齊。

RIGHT

public static final int RIGHT

表示右對(duì)齊。

此常量表示文本與容器的右邊緣對(duì)齊。

START

public static final int START

表示文本與容器的開頭對(duì)齊。

Since:

3

TOP

public static final int TOP

表示頂部對(duì)齊。

此常量指示文本與容器的頂部邊緣對(duì)齊。

VERTICAL_CENTER

public static final int VERTICAL_CENTER

表示垂直居中對(duì)齊。

此常量表示文本在容器中垂直居中。

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

TextAlignment

public TextAlignment()

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

掃描二維碼

下載編程獅App

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

編程獅公眾號(hào)