!13095 Grid组件新增alignitems接口

Merge pull request !13095 from tomkl123/cherry-pick-1722823302
This commit is contained in:
openharmony_ci 2024-08-06 02:44:46 +00:00 committed by Gitee
commit 7ae2b2382e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -294,6 +294,39 @@ declare enum GridDirection {
ColumnReverse,
}
/**
* Declare grid item alignment status
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
declare enum GridItemAlignment {
/**
* Use the default alignment of the Grid.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
DEFAULT = 0,
/**
* The height of the tallest grid item in the current line
* will be used as the height for the other items in the same line
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
STRETCH = 1,
}
/**
* The attribute of scrollbar to compute scrollbar position and height.
*
@ -1107,6 +1140,18 @@ declare class GridAttribute extends ScrollableCommonMethod<GridAttribute> {
*/
friction(value: number | Resource): GridAttribute;
/**
* Set the alignment of grid items.
*
* @param { Optional<GridItemAlignment> } alignment - Items alignment
* @returns { GridAttribute } The attribute of the grid.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
alignItems(alignment: Optional<GridItemAlignment>): GridAttribute;
/**
* Called When sliding the grid.
*