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 7ec01cd1c95acabd638e8f78acef211df9a65aee..2c2803ddd9ef2b27c80651ea30214036a745545b 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,支持相机预览等能力。