From 7d3ccff8948f9640ef66f96162be1c246af4e814 Mon Sep 17 00:00:00 2001 From: xiangyuan6 Date: Wed, 27 Aug 2025 14:35:25 +0800 Subject: [PATCH] 1.2 TextArea align Signed-off-by: xiangyuan6 --- api/arkui/component/text.static.d.ets | 15 +++++++++ api/arkui/component/textCommon.static.d.ets | 35 +++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/api/arkui/component/text.static.d.ets b/api/arkui/component/text.static.d.ets index 1c4e93d132..1516b25b50 100644 --- a/api/arkui/component/text.static.d.ets +++ b/api/arkui/component/text.static.d.ets @@ -217,6 +217,21 @@ export declare interface TextAttribute extends CommonMethod { * @since 20 */ default textAlign(value: TextAlign | undefined): this; + + /** + * Set the vertical align of the whole text content. + * + *

NOTE: + *
If both textContentAlign and align attribute is set, textContentAlign is valid. + *

+ * + * @param { Optional } textContentAlign - The default value is TOP. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + */ + textContentAlign(textContentAlign: Optional): TextAttribute; + /** * Called when the vertical center mode of the font is set. * diff --git a/api/arkui/component/textCommon.static.d.ets b/api/arkui/component/textCommon.static.d.ets index dd08c7621b..2d82f24d90 100644 --- a/api/arkui/component/textCommon.static.d.ets +++ b/api/arkui/component/textCommon.static.d.ets @@ -183,6 +183,41 @@ export declare enum TextDeleteDirection { */ FORWARD = 1 } + +/** + * Alignment of text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + */ +export declare enum TextContentAlign { + /** + * Top the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + */ + TOP = 0, + + /** + * Center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + */ + CENTER = 1, + + /** + * Bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 21 + */ + BOTTOM = 2 +} + + /** * Defines menu type. * -- Gitee