From ca302a17a34bde7813fc44ea153efd218d696335 Mon Sep 17 00:00:00 2001 From: lanyill Date: Wed, 7 Sep 2022 14:58:01 +0800 Subject: [PATCH] =?UTF-8?q?xcomponent=E6=96=87=E6=A1=A3=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lanyill --- .../arkui-ts/ts-basic-components-xcomponent.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md index de7f7e9a83..9dcda24971 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md @@ -49,7 +49,7 @@ onDestroy(event: () => void ) ## XComponentController -xcomponent 组件的控制器,可以将此对象绑定至XComponent组件,然后通过控制器带调用组件方法。 +xcomponent 组件的控制器,可以将此对象绑定至XComponent组件,然后通过控制器来调用组件方法。 ### 创建对象 @@ -59,7 +59,7 @@ xcomponentController: XComponentController = new XComponentController() ### getXComponentSurfaceId -getXComponentSurfaceId(): string +getXComponentSurfaceId() 获取XComponent对应Surface的ID,供@ohos接口使用,比如camera相关接口。 @@ -71,9 +71,10 @@ getXComponentSurfaceId(): string | ------ | ----------------------- | | string | XComponent持有Surface的ID。 | + ### setXComponentSurfaceSize -setXComponentSurfaceSize(value: {surfaceWidth: number, surfaceHeight: number}): void +setXComponentSurfaceSize(value: {surfaceWidth: number, surfaceHeight: number}) 设置XComponent持有Surface的宽度和高度。 @@ -86,9 +87,10 @@ setXComponentSurfaceSize(value: {surfaceWidth: number, surfaceHeight: number}): | surfaceWidth | number | 是 | XComponent持有Surface的宽度。 | | surfaceHeight | number | 是 | XComponent持有Surface的高度。 | + ### getXComponentContext -getXComponentContext(): Object +getXComponentContext() 获取XComponent实例对象的context。 @@ -98,6 +100,7 @@ getXComponentContext(): Object | ------ | ---------------------------------------- | | Object | 获取XComponent实例对象的context,context包含的具体接口方法由开发者自定义。 | + ## 示例 提供surface类型XComponent,支持相机预览等能力。 -- GitLab