From ea17f96d7676429c4af6ea10e42f2b8c79f984bc Mon Sep 17 00:00:00 2001 From: mayunteng_1 Date: Mon, 22 May 2023 14:09:25 +0800 Subject: [PATCH] update msdp callback dos Signed-off-by:mayunteng_1 Signed-off-by: mayunteng_1 --- .../reference/apis/js-apis-stationary.md | 2 +- .../reference/apis/Readme-CN.md | 1 - .../reference/apis/js-apis-measure.md | 75 ------------------- .../reference/apis/js-apis-stationary.md | 2 +- 4 files changed, 2 insertions(+), 78 deletions(-) delete mode 100644 zh-cn/application-dev/reference/apis/js-apis-measure.md diff --git a/en/application-dev/reference/apis/js-apis-stationary.md b/en/application-dev/reference/apis/js-apis-stationary.md index e065e9478c..6c2ec0a365 100644 --- a/en/application-dev/reference/apis/js-apis-stationary.md +++ b/en/application-dev/reference/apis/js-apis-stationary.md @@ -123,7 +123,7 @@ Unsubscribes from the device status. | -------------------- | -------------------------------------------------- | ---- | ---------------------------- | | activity | [ActivityType](#activitytype) | Yes | Device status type. | | event | [ActivityEvent](#activityevent) | Yes | Event type. | -| callback | Callback<[ActivityResponse](#activityresponse)\> | No | Callback used to receive reported data. | +| callback | Callback<[ActivityResponse](#activityresponse)\> | No | Callback used to receive reported data, if the callback parameter is not passed, all callbacks subscribed to this type under this process will be removed. | **Example** diff --git a/zh-cn/application-dev/reference/apis/Readme-CN.md b/zh-cn/application-dev/reference/apis/Readme-CN.md index 152db94759..b65ca834fc 100755 --- a/zh-cn/application-dev/reference/apis/Readme-CN.md +++ b/zh-cn/application-dev/reference/apis/Readme-CN.md @@ -175,7 +175,6 @@ - [@ohos.pluginComponent(PluginComponentManager)](js-apis-plugincomponent.md) - [@ohos.promptAction (弹窗)](js-apis-promptAction.md) - [@ohos.router (页面路由)](js-apis-router.md) - - [@ohos.measure (文本计算)](js-apis-measure.md) - 图形图像 - [@ohos.animation.windowAnimationManager (窗口动画管理)](js-apis-windowAnimationManager.md) diff --git a/zh-cn/application-dev/reference/apis/js-apis-measure.md b/zh-cn/application-dev/reference/apis/js-apis-measure.md deleted file mode 100644 index 95bd545157..0000000000 --- a/zh-cn/application-dev/reference/apis/js-apis-measure.md +++ /dev/null @@ -1,75 +0,0 @@ -# @ohos.measure (文本计算) - -本模块提供文本宽度、高度等相关计算。 - -> **说明** -> -> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 - - -## 导入模块 - -``` -import measure from '@ohos.measure' -``` - -## measure.measureText - -measureText(options: MeasureOptions): double - -计算指定文本单行布局下的宽度。 - -**系统能力:** SystemCapability.ArkUI.ArkUI.Full - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------------------------------- | ---- | --------- | -| options | [MeasureOptions](#measureoptions) | 是 | 被计算文本描述信息。 | - -**返回值:** - -| 类型 | 说明 | -| ------------ | --------- | -| double | 文本宽度。
**说明:** 单位px。 | - - -**示例:** - -```ts -import measure from '@ohos.measure' -@Entry -@Component -struct Index { - @State message: string = 'Hello World' - @State textWidth : number = measure.measureText({ - textContent: "Hello word", - fontSize: '50px' - }) - build() { - Row() { - Column() { - Text("The width of 'Hello World': " + this.textWidth) - } - .width('100%') - } - .height('100%') - } -} -``` - -## MeasureOptions - -被计算文本属性。 - -**系统能力:** SystemCapability.ArkUI.ArkUI.Full - -| 名称 | 类型 | 必填 | 说明 | -| -------------- | -------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------- | -| textContent | string | 是 | 设置被计算文本内容。 | -| fontSize | number \| string \| [Resource](../arkui-ts/ts-types.md#resource) | 否 | 设置被计算文本字体大小,fontSize为number类型时,使用fp单位。
默认值:16fp。
**说明:**不支持设置百分比字符串。 | -| fontStyle | number \| [FontStyle](../arkui-ts/ts-appendix-enums.md#fontstyle) | 否 | 设置被计算文本字体样式。
默认值:FontStyle.Normal | -| fontWeight | number \| string \| [FontWeight](../arkui-ts/ts-appendix-enums.md#fontweight) | 否 | 设置被计算文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。string类型仅支持number类型取值的字符串形式,例如"400",以及"bold"、"bolder"、"lighter"、"regular"、"medium",分别对应FontWeight中相应的枚举值。
默认值:FontWeight.Normal| -| fontFamily | string \| [Resource](../arkui-ts/ts-types.md#resource) | 否 | 设置被计算文本字体列表。默认字体'HarmonyOS Sans',且当前只支持这种字体。| -| letterSpacing | number \| string | 否 | 设置被计算文本字符间距。| - diff --git a/zh-cn/application-dev/reference/apis/js-apis-stationary.md b/zh-cn/application-dev/reference/apis/js-apis-stationary.md index 04ee61e586..36aa91441d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-stationary.md +++ b/zh-cn/application-dev/reference/apis/js-apis-stationary.md @@ -123,7 +123,7 @@ off(activity: ActivityType, event: ActivityEvent, callback?: Callback<Activit | -------------------- | -------------------------------------------------- | ---- | ---------------------------- | | activity | [ActivityType](#activitytype) | 是 | 设备状态能力类型。 | | event | [ActivityEvent](#activityevent) | 是 | 事件类型。 | -| callback | Callback<[ActivityResponse](#activityresponse)\> | 否 | 回调函数,接收上报状态变化事件。 | +| callback | Callback<[ActivityResponse](#activityresponse)\> | 否 | 回调函数,接收上报状态变化事件,如果没有传递callback参数,会移除该进程下订阅该类型得所有callback。 | **示例:** -- GitLab