openharmony 鸿蒙 capi-native-node-h-nodeattributetype-xcomponent

2026-08-25 浏览 (1)

ArkUI_NodeAttributeType (XComponent Attribute)

enum ArkUI_NodeAttributeType

Overview

Enumerates the XComponent attributes that can be set by ArkUI on the native side.

Since: 12

Related module: ArkUI_NativeModule

Header file: native_node.h

NODE_XCOMPONENT_ID

NODE_XCOMPONENT_ID = MAX_NODE_SCOPE_NUM * ARKUI_NODE_XCOMPONENT = 12000

ID of the XComponent component. This attribute can be set and obtained as required through APIs.
The format of the ArkUI_AttributeItem parameter for setting the attribute and the format of the return value ArkUI_AttributeItem are as follows.

Since: 12

Parameters

NameDescription
.stringComponent ID.

Returns

TypeDescription
.stringComponent ID.

NODE_XCOMPONENT_TYPE

NODE_XCOMPONENT_TYPE = 12001

Type of the XComponent component. This attribute is read-only.
The type of the XComponent component must be explicitly set during creation using ARKUI_NODE_XCOMPONENT or ARKUI_NODE_XCOMPONENT_TEXTURE in ArkUI_NodeType, and cannot be modified afterward.
Attempting to change the type through setAttribute will cause rendering exceptions.
The format of the return value ArkUI_AttributeItem is as follows.

Since: 12

Returns

TypeDescription
.value[0].i32Type of the XComponent component. The parameter type is ArkUI_XComponentType.

NODE_XCOMPONENT_SURFACE_SIZE

NODE_XCOMPONENT_SURFACE_SIZE = 12002

Size of the XComponent component. This attribute is read-only.
Attempting to modify the size through setAttribute will have no effect.
The format of the return value ArkUI_AttributeItem is as follows.

Since: 12

Returns

TypeDescription
.value[0].u32Width, in px.
.value[1].u32Height, in px.

NODE_XCOMPONENT_SURFACE_RECT

NODE_XCOMPONENT_SURFACE_RECT = 12003

Display area of the surface held by the XComponent component.This attribute can be set and obtained as required through APIs.
The format of the ArkUI_AttributeItem parameter for setting the attribute and the format of the return value ArkUI_AttributeItem are as follows.

Since: 18

Parameters

NameDescription
.value[0].i32X-coordinate of the surface display area relative to the upper left corner of the XComponent component, in px.
.value[1].i32Y-coordinate of the surface display area relative to the upper left corner of the XComponent component, in px.
.value[2].i32Width of the surface display area, in px.
.value[3].i32Height of the surface display area, in px.

Returns

TypeDescription
.value[0].i32X-coordinate of the surface display area relative to the upper left corner of the XComponent component, in px.
.value[1].i32Y-coordinate of the surface display area relative to the upper left corner of the XComponent component, in px.
.value[2].i32Width of the surface display area, in px.
.value[3].i32Height of the surface display area, in px.

NODE_XCOMPONENT_ENABLE_ANALYZER

NODE_XCOMPONENT_ENABLE_ANALYZER = 12004

Whether to enable the image analyzer for the XComponent component. This attribute can be set and obtained as required through APIs.
The format of the ArkUI_AttributeItem parameter for setting the attribute and the format of the return value ArkUI_AttributeItem are as follows.

Since: 18

Parameters

NameDescription
.value[0].i32Whether to enable the image analyzer. 1: enable the image analyzer. 0: disable the image analyzer. The default value is 0.

Returns

TypeDescription
.value[0].i32Whether the image analyzer is enabled. 1: The image analyzer is enabled. 0: The image analyzer is disabled. The default value is 0.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 arkts-apis-uicontext-contextmenucontroller

openharmony 鸿蒙 errorcode-canvas

openharmony 鸿蒙 capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent

openharmony 鸿蒙 errorcode-bindSheet

openharmony 鸿蒙 js-apis-arkui-uiExtension-sys

openharmony 鸿蒙 capi-arkui-accessibility-arkui-accessibilityeventinfo

openharmony 鸿蒙 capi-arkui-rendernodeutils

openharmony 鸿蒙 js-apis-arkui-node

openharmony 鸿蒙 capi-native-node-h

openharmony 鸿蒙 capi-arkui-nativemodule-arkui-listitemswipeactionitem

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/alU8IPb3