[NDK] fix ListAlignListItem

Signed-off-by:lisitaolisitao3@huawei.com

Signed-off-by: lisitao <lisitao3@huawei.com>
Change-Id: Id11532c78c04c73771dd18c30ad1d51103f65a3d
This commit is contained in:
lisitao 2024-05-27 08:42:09 +00:00
parent 48f334ba9e
commit daefedc81c
2 changed files with 3 additions and 2 deletions

View File

@ -645,7 +645,8 @@ void ListModelNG::SetLaneGutter(FrameNode* frameNode, const Dimension& laneGutte
int32_t ListModelNG::GetListItemAlign(FrameNode* frameNode)
{
CHECK_NULL_RETURN(frameNode, 0);
return static_cast<int32_t>(frameNode->GetLayoutProperty<ListLayoutProperty>()->GetListItemAlign().value());
return static_cast<int32_t>(
frameNode->GetLayoutProperty<ListLayoutProperty>()->GetListItemAlignValue(V2::ListItemAlign::START));
}
void ListModelNG::SetListItemAlign(FrameNode* frameNode, V2::ListItemAlign listItemAlign)

View File

@ -5347,7 +5347,7 @@ const ArkUI_AttributeItem* GetListCachedCount(ArkUI_NodeHandle node)
int32_t SetListAlignListItem(ArkUI_NodeHandle node, const ArkUI_AttributeItem* item)
{
CHECK_NULL_RETURN(item, ERROR_CODE_PARAM_INVALID);
if (item->size != 1 || CheckAttributeIsListItemAlign(item->value[0].i32)) {
if (item->size != 1 || !CheckAttributeIsListItemAlign(item->value[0].i32)) {
return ERROR_CODE_PARAM_INVALID;
}
GetFullImpl()->getNodeModifiers()->getListModifier()->setAlignListItem(node->uiNodeHandle, item->value[0].i32);