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
| Name | Description |
|---|---|
| .string | Component ID. |
Returns
| Type | Description |
|---|---|
| .string | Component 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
| Type | Description |
|---|---|
| .value[0].i32 | Type 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
| Type | Description |
|---|---|
| .value[0].u32 | Width, in px. |
| .value[1].u32 | Height, 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
| Name | Description |
|---|---|
| .value[0].i32 | X-coordinate of the surface display area relative to the upper left corner of the XComponent component, in px. |
| .value[1].i32 | Y-coordinate of the surface display area relative to the upper left corner of the XComponent component, in px. |
| .value[2].i32 | Width of the surface display area, in px. |
| .value[3].i32 | Height of the surface display area, in px. |
Returns
| Type | Description |
|---|---|
| .value[0].i32 | X-coordinate of the surface display area relative to the upper left corner of the XComponent component, in px. |
| .value[1].i32 | Y-coordinate of the surface display area relative to the upper left corner of the XComponent component, in px. |
| .value[2].i32 | Width of the surface display area, in px. |
| .value[3].i32 | Height 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
| Name | Description |
|---|---|
| .value[0].i32 | Whether to enable the image analyzer. 1: enable the image analyzer. 0: disable the image analyzer. The default value is 0. |
Returns
| Type | Description |
|---|---|
| .value[0].i32 | Whether 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