From b15b54180f3d66322ed3e1e0245037c8d64aa8d0 Mon Sep 17 00:00:00 2001 From: tomkl123 Date: Sat, 13 Sep 2025 08:57:39 +0800 Subject: [PATCH] Scrollable components support contentStartOffset and contentEndOffset Signed-off-by: tomkl123 Change-Id: I60626150c49e2a3311bb751e657c8844a048de38 --- api/@internal/component/ets/common.d.ts | 30 +++++++++++++++++++++++++ api/@internal/component/ets/list.d.ts | 30 +++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 6655036536..8cbca9db64 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -34093,6 +34093,36 @@ declare class ScrollableCommonMethod extends CommonMethod { */ friction(value: number | Resource): T; + /** + * Sets the offset from the start of the content to the boundary of the scrollable display area. + * + * @param { number | Resource } offset - Offset from the start of the content to the boundary of + * the scrollable display area. + *
Default value: 0 + *
Unit: vp + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 22 + */ + contentStartOffset(offset: number | Resource): T; + + /** + * Sets the offset from the end of the content to the boundary of the scrollable display area. + * + * @param { number | Resource } offset - Offset from the start of the content to the boundary of + * the scrollable display area. + *
Default value: 0 + *
Unit: vp + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 22 + */ + contentEndOffset(offset: number | Resource): T; + /** * Triggered when the scrollable component scrolls. * diff --git a/api/@internal/component/ets/list.d.ts b/api/@internal/component/ets/list.d.ts index 2020fab817..b6d9a70657 100644 --- a/api/@internal/component/ets/list.d.ts +++ b/api/@internal/component/ets/list.d.ts @@ -1748,6 +1748,21 @@ declare class ListAttribute extends ScrollableCommonMethod { */ contentStartOffset(value: number): ListAttribute; + /** + * Sets the offset from the start of the list content to the boundary of the list display area. + * + * @param { number | Resource } offset - Offset from the start of the list content to the boundary of + * the list display area. + *
Default value: 0 + *
Unit: vp + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 22 + */ + contentStartOffset(offset: number | Resource): ListAttribute; + /** * Called when need to decide contentEndOffset the list will show. * @param { number } value - the value Of endOffset. @@ -1770,6 +1785,21 @@ declare class ListAttribute extends ScrollableCommonMethod { */ contentEndOffset(value: number): ListAttribute; + /** + * Sets the offset from the end of the list content to the boundary of the list display area. + * + * @param { number | Resource } offset - Offset from the end of the list content to the boundary of + * the list display area. + *
Default value: 0 + *
Unit: vp + * @returns { ListAttribute } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 22 + */ + contentEndOffset(offset: number | Resource): ListAttribute; + /** * Called when the ListItem split line style is set. * -- Gitee