diff --git a/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0001.gif b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0001.gif new file mode 100644 index 0000000000000000000000000000000000000000..fc737da287358cd81c65567e17da1bd4d701edff Binary files /dev/null and b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0001.gif differ diff --git a/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0002.gif b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0002.gif new file mode 100644 index 0000000000000000000000000000000000000000..9e3ff82c3de3a8867949b0d65aa4ffe55360e7cb Binary files /dev/null and b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0002.gif differ diff --git a/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0004.gif b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0004.gif new file mode 100644 index 0000000000000000000000000000000000000000..3b8462cf93c07e4b92c250bcb46409cc81e5129f Binary files /dev/null and b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0004.gif differ diff --git a/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0005.gif b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0005.gif new file mode 100644 index 0000000000000000000000000000000000000000..2bb6aa6c2a2086f16ae6149e9d3e4b2340d6fe37 Binary files /dev/null and b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0005.gif differ diff --git a/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0006.gif b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0006.gif new file mode 100644 index 0000000000000000000000000000000000000000..2bb6aa6c2a2086f16ae6149e9d3e4b2340d6fe37 Binary files /dev/null and b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0006.gif differ diff --git a/zh-cn/application-dev/reference/apis/js-apis-prompt.md b/zh-cn/application-dev/reference/apis/js-apis-prompt.md index fb04353173252c684eb05d1341f46f82a6cb13ac..64b154d5804aba6e8cf59848d1131733e1922d90 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-prompt.md +++ b/zh-cn/application-dev/reference/apis/js-apis-prompt.md @@ -35,6 +35,8 @@ prompt.showToast({ }); ``` + ![zh-cn_image_0001](figures/zh-cn_image_0001.gif) + ## ShowToastOptions 文本提示框的选项。 @@ -92,6 +94,8 @@ prompt.showDialog({ }) ``` + ![zh-cn_image_0002](figures/zh-cn_image_0002.gif) + ## prompt.showDialog showDialog(options: ShowDialogOptions, callback: AsyncCallback<ShowDialogSuccessResponse>):void @@ -132,6 +136,8 @@ prompt.showDialog({ }); ``` + ![zh-cn_image_0004](figures/zh-cn_image_0004.gif) + ## ShowDialogOptions 对话框的选项。 @@ -195,6 +201,8 @@ prompt.showActionMenu({ }) ``` + ![zh-cn_image_0005](figures/zh-cn_image_0005.gif) + ## prompt.showActionMenu showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse> @@ -238,6 +246,8 @@ prompt.showActionMenu({ console.info('showActionMenu error: ' + err); }) ``` + ![zh-cn_image_0006](figures/zh-cn_image_0006.gif) + ## ActionMenuOptions 操作菜单的选项。 diff --git a/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001238952377.png b/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001238952377.png new file mode 100644 index 0000000000000000000000000000000000000000..eb03ebe25132eb551b633d052cdfc984eda432ee Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001238952377.png differ diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-basic-piece.md b/zh-cn/application-dev/reference/arkui-js/js-components-basic-piece.md index 6052a8fea067fd39a6870faad84d93c0f80546f1..cbf3e14451c1f196726dbf3e612a7891d5804a2e 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-basic-piece.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-basic-piece.md @@ -1,10 +1,10 @@ # piece +一种块状的入口,可包含图片和文本。常用于展示收件人,例如:邮件收件人或信息收件人。 + > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 从API version 5开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 -一种块状的入口,可包含图片和文本。常用于展示收件人,例如:邮件收件人或信息收件人。 - ## 子组件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md index 0623fba069c2d5b65fc0cf8ddffe7da16ad2b162..1ea2bfef71704df0976b544566013e6afa43bc02 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md @@ -21,9 +21,9 @@ Image(src: string | PixelMap | Resource) **参数:** -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| ---- | ---------------------------------------- | ---- | ---- | ---------------------------------------- | -| src | string\| [PixelMap](../apis/js-apis-image.md#pixelmap7)\| [Resource](ts-types.md#resource) | 是 | - | 图片的数据源,支持本地图片和网络图片。
当使用相对路径引用图片资源时,例如`Image("common/test.jpg")`,不支持该Image组件被跨包/跨模块调用,建议使用`$r`方式来管理需全局使用的图片资源。
\- 支持的图片格式包括png、jpg、bmp、svg和gif。
\- 支持`Base64`字符串。格式`data:image/[png\|jpeg\|bmp\|webp];base64,[base64 data]`, 其中`[base64 data]`为`Base64`字符串数据。
\- 支持`dataability://`路径前缀的字符串,用于访问通过data ability提供的图片路径。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| ------ | ------------------------------------------------------------ | ---- | ------ | ------------------------------------------------------------ | +| src | string\| [PixelMap](../apis/js-apis-image.md#pixelmap7)\| [Resource](ts-types.md#resource) | 是 | - | 图片的数据源,支持本地图片和网络图片。
当使用相对路径引用图片资源时,例如`Image("common/test.jpg")`,不支持该Image组件被跨包/跨模块调用,建议使用`$r`方式来管理需全局使用的图片资源。
\- 支持的图片格式包括png、jpg、bmp、svg和gif。
\- 支持`Base64`字符串。格式`data:image/[png\|jpeg\|bmp\|webp];base64,[base64 data]`, 其中`[base64 data]`为`Base64`字符串数据。
\- 支持`dataability://`路径前缀的字符串,用于访问通过data ability提供的图片路径。
\- 支持file:///data/storage路径前缀的字符串,用于读取本应用安装目录下files文件夹下的图片资源。需要保证目录包路径下的文件有可读权限。 | ## 属性 @@ -265,3 +265,53 @@ struct ImageExample3 { ``` ![zh-cn_image_0000001205972610](figures/zh-cn_image_0000001205972610.gif) + +### 渲染沙箱路径图片 + +``` +import fileio from '@ohos.fileio'; +import image from '@ohos.multimedia.image'; + +const EMPTY_PATH = 'file://'; + +@Entry +@Component +struct LoadImageExample { + @State fileContent: string = ''; + @State path: string = EMPTY_PATH; + @State accountInfoHeadPic: any = ''; + + build() { + Column() { + Button('读取沙箱图片') + .margin({ bottom: 10 }) + .onClick(() => { + try { + this.path = EMPTY_PATH; + let context = getContext(this); + let path = context.getApplicationContext().filesDir + '/icon.png'; + console.log(`读取沙箱图片=========>${path}`); + let fd = fileio.openSync(path, 0o100, 0o666); + console.log(`create file========>${fd}`); + let srcPath = context.bundleCodeDir + '/entry/resource/base/media/icon.png'; + fileio.copyFileSync(srcPath, path); + console.log(`error:=============>${e.message}`); + } + }) + Button('读取资源图片') + .margin({ bottom: 10 }) + .onClick(() => { + this.path = EMPTY_PATH; + this.path += getContext(this.bundleCodeDir + '/entry/resource/base/media/icon.png'); + }) + Text(`图片路径:${this.path}`) + .fontSize(20) + .margin({ bottom: 10 }) + Image(this.path) + .width(100) + .height(100) + } + .width('100%').height('100%') + } +} +``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-slider.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-slider.md index e9de0a7fa0698da2ff19fe10516192f7675896ae..f5786028ffd5756f184eba3bef9ddf36c4c1e0b8 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-slider.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-slider.md @@ -55,9 +55,9 @@ Slider(options?:{value?: number, min?: number, max?: number, step?: number, styl 通用事件仅支持:OnAppear,OnDisAppear。 -| 名称 | 功能描述 | -| ---------------------------------------- | ---------------------------------------- | -| onChange(callback: (value: number, mode: SliderChangeMode) => void) | Slider滑动时触发事件回调。
value:当前进度值。
mode:拖动状态。 | +| 名称 | 功能描述 | +| ------------------------------------------------------------ | ------------------------------------------------------------ | +| onChange(callback: (value: number, mode: SliderChangeMode) => void) | Slider滑动时触发事件回调。
value:当前进度值。若返回值有小数,可使用Math.toFixed()将数据处理为想要的精度。
mode:拖动状态。 | ## SliderChangeMode枚举说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md b/zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md index 925922055cdb99cffba81d22763239222e36801b..21fae4b0b4ccbb6642685d9193cd676aee6737d1 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md @@ -773,7 +773,7 @@ clearRect(x: number, y: number, w: number, h: number): void Canvas(this.context) .width('100%') .height('100%') - .backgroundColor('#ffff00') + .backgroundColor('#ffffff') .onReady(() =>{ this.context.fillStyle = 'rgb(0,0,255)' this.context.fillRect(0,0,500,500) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md index d240b7539f15bc40559e4c365447c737eebbb897..da58b8c0cd2e6baa7e6dc4a0f4256b67d38d1e8e 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-action-sheet.md @@ -19,24 +19,24 @@ show(value: { title: string | Resource, message: string  定义列表弹窗并弹出。 **参数:** - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | -------- | -------- | -------- | - | title | string \| [Resource](ts-types.md#resource) | 是 | - | 弹窗标题。 | - | message | string \| [Resource](ts-types.md#resource) | 是 | - | 弹窗内容。 | - | autoCancel | boolean | 否 | true | 点击遮障层时,是否关闭弹窗。 | - | confirm | {
value: string \| [Resource](ts-types.md#resource),
action: () => void
} | 否 | - | 确认按钮的文本内容和点击回调。
value:按钮文本内容。
action: 按钮选中时的回调。 | - | cancel | () => void | 否 | - | 点击遮障层关闭dialog时的回调。 | - | alignment | [DialogAlignment](ts-methods-custom-dialog-box.md) | 否 | DialogAlignment.Default | 弹窗在竖直方向上的对齐方式。 | - | offset | {
dx: number \| string \| [Resource](ts-types.md#resource),
dy: number \| string \| [Resource](ts-types.md#resource)
} | 否 | {
dx: 0,
dy: 0
} | 弹窗相对alignment所在位置的偏移量。 | - | sheets | Array<SheetInfo> | 是 | - | 设置选项内容,每个选择项支持设置图片、文本和选中的回调。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| -------- | -------- | -------- | -------- | -------- | +| title | string \| [Resource](ts-types.md#resource) | 是 | - | 弹窗标题。 | +| message | string \| [Resource](ts-types.md#resource) | 是 | - | 弹窗内容。 | +| autoCancel | boolean | 否 | true | 点击遮障层时,是否关闭弹窗。 | +| confirm | {
value: string \| [Resource](ts-types.md#resource),
action: () => void
} | 否 | - | 确认按钮的文本内容和点击回调。
value:按钮文本内容。
action: 按钮选中时的回调。 | +| cancel | () => void | 否 | - | 点击遮障层关闭dialog时的回调。 | +| alignment | [DialogAlignment](ts-methods-custom-dialog-box.md) | 否 | DialogAlignment.Default | 弹窗在竖直方向上的对齐方式。 | +| offset | {
dx: number \| string \| [Resource](ts-types.md#resource),
dy: number \| string \| [Resource](ts-types.md#resource)
} | 否 | {
dx: 0,
dy: 0
} | 弹窗相对alignment所在位置的偏移量。 | +| sheets | Array<SheetInfo> | 是 | - | 设置选项内容,每个选择项支持设置图片、文本和选中的回调。 | ## SheetInfo接口说明 - - | 参数名 | 参数类型 | 必填 | 参数描述 | - | ------ | ------------------------------------------------------------ | ---- | ----------------- | - | title | string \| [Resource](../../ui/ts-types.md#resource) | 是 | 选项的文本内容。 | - | icon | string \| [Resource](../../ui/ts-types.md#resource) | 否 | 选项的图标,默认无图标显示。 | - | action | ()=>void | 是 | 选项选中的回调。 | + +| 参数名 | 参数类型 | 必填 | 参数描述 | +| ------ | ------------------------------------------------------------ | ---- | ----------------- | +| title | string \| [Resource](../../ui/ts-types.md#resource) | 是 | 选项的文本内容。 | +| icon | string \| [Resource](../../ui/ts-types.md#resource) | 否 | 选项的图标,默认无图标显示。 | +| action | ()=>void | 是 | 选项选中的回调。 | ## 示例 @@ -57,26 +57,26 @@ struct ActionSheetExapmle { confirm: { value: 'Confirm button', action: () => { - console.log('Get Alert Dialog handled') + console.log('Get Alert Dialog handled'); } }, sheets: [ { title: 'apples', action: () => { - console.error('apples') + console.log('apples'); } }, { title: 'bananas', action: () => { - console.error('bananas') + console.log('bananas'); } }, { title: 'pears', action: () => { - console.error('pears') + console.log('pears'); } } ] diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-alert-dialog-box.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-alert-dialog-box.md index eadfff57f805c023f5f78c1b982e790559779819..fb033974e51836c49150826b3930fa0d8bfbe2f4 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-alert-dialog-box.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-alert-dialog-box.md @@ -14,29 +14,29 @@ | show | value: { AlertDialogParamWithConfirm \| AlertDialogParamWithButtons} | - | 定义并显示AlertDialog组件。 | ## AlertDialogParamWithConfirm对象说明 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | -------- | -------- | -------- | - | title | string \| [Resource](ts-types.md#resource) | 否 | - | 弹窗标题。 | - | message | string \| [Resource](ts-types.md#resource) | 是 | - | 弹窗内容。 | - | autoCancel | boolean | 否 | true | 点击遮障层时,是否关闭弹窗。 | - | confirm | {
value: string \| [Resource](ts-types.md#resource),
fontColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
backgroundColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
action: () => void
} | 否 | - | 确认按钮的文本内容、文本色、按钮背景色和点击回调。 | - | cancel | () => void | 否 | - | 点击遮障层关闭dialog时的回调。 | - | alignment | [DialogAlignment](ts-methods-custom-dialog-box.md#dialogalignment枚举说明) | 否 | DialogAlignment.Default | 弹窗在竖直方向上的对齐方式。 | - | offset | {
dx: Length \| [Resource](ts-types.md#resource),
dy: Length  \| [Resource](ts-types.md#resource)
} | 否 | - | 弹窗相对alignment所在位置的偏移量。 | - | gridCount | number | 否 | - | 弹窗容器宽度所占用栅格数。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| -------- | -------- | -------- | -------- | -------- | +| title | string \| [Resource](ts-types.md#resource) | 否 | - | 弹窗标题。 | +| message | string \| [Resource](ts-types.md#resource) | 是 | - | 弹窗内容。 | +| autoCancel | boolean | 否 | true | 点击遮障层时,是否关闭弹窗。 | +| confirm | {
value: string \| [Resource](ts-types.md#resource),
fontColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
backgroundColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
action: () => void
} | 否 | - | 确认按钮的文本内容、文本色、按钮背景色和点击回调。 | +| cancel | () => void | 否 | - | 点击遮障层关闭dialog时的回调。 | +| alignment | [DialogAlignment](ts-methods-custom-dialog-box.md#dialogalignment枚举说明) | 否 | DialogAlignment.Default | 弹窗在竖直方向上的对齐方式。 | +| offset | {
dx: Length \| [Resource](ts-types.md#resource),
dy: Length  \| [Resource](ts-types.md#resource)
} | 否 | - | 弹窗相对alignment所在位置的偏移量。 | +| gridCount | number | 否 | - | 弹窗容器宽度所占用栅格数。
**说明:**
当gridCount小于等于0时,弹窗宽度是固定的;大于0时,按照设置的数值显示宽度,最大值为4,若值为小数,则向下取整。 | ## AlertDialogParamWithButtons对象说明 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | -------- | -------- | -------- | - | title | string \|& [Resource](ts-types.md#resource) | 否 | - | 弹窗标题。 | - | message | string \|& [Resource](ts-types.md#resource) | 是 | - | 弹窗内容。 | - | autoCancel | boolean | 否 | true | 点击遮障层时,是否关闭弹窗。 | - | primaryButton | {
value: string \| [Resource](ts-types.md#resource),
fontColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
backgroundColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
action: () => void;
} | 否 | - | 按钮的文本内容、文本色、按钮背景色和点击回调。 | - | secondaryButton | {
value: string \| [Resource](ts-types.md#resource),
fontColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
backgroundColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
action: () => void;
} | 否 | - | 按钮的文本内容、文本色、按钮背景色和点击回调。 | - | cancel | () => void | 否 | - | 点击遮障层关闭dialog时的回调。 | - | alignment | [DialogAlignment](ts-methods-custom-dialog-box.md#dialogalignment枚举说明) | 否 | DialogAlignment.Default | 弹窗在竖直方向上的对齐方式。 | - | offset | {
dx: Length \| [Resource](ts-types.md#resource),
dy: Length  \| [Resource](ts-types.md#resource)
} | 否 | - | 弹窗相对alignment所在位置的偏移量。 | - | gridCount | number | 否 | - | 弹窗容器宽度所占用栅格数。 | +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| -------- | -------- | -------- | -------- | -------- | +| title | string \|& [Resource](ts-types.md#resource) | 否 | - | 弹窗标题。 | +| message | string \|& [Resource](ts-types.md#resource) | 是 | - | 弹窗内容。 | +| autoCancel | boolean | 否 | true | 点击遮障层时,是否关闭弹窗。 | +| primaryButton | {
value: string \| [Resource](ts-types.md#resource),
fontColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
backgroundColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
action: () => void;
} | 否 | - | 按钮的文本内容、文本色、按钮背景色和点击回调。 | +| secondaryButton | {
value: string \| [Resource](ts-types.md#resource),
fontColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
backgroundColor?: Color \| number \| string \| [Resource](ts-types.md#resource),
action: () => void;
} | 否 | - | 按钮的文本内容、文本色、按钮背景色和点击回调。 | +| cancel | () => void | 否 | - | 点击遮障层关闭dialog时的回调。 | +| alignment | [DialogAlignment](ts-methods-custom-dialog-box.md#dialogalignment枚举说明) | 否 | DialogAlignment.Default | 弹窗在竖直方向上的对齐方式。 | +| offset | {
dx: Length \| [Resource](ts-types.md#resource),
dy: Length  \| [Resource](ts-types.md#resource)
} | 否 | - | 弹窗相对alignment所在位置的偏移量。 | +| gridCount | number | 否 | - | 弹窗容器宽度所占用栅格数。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md index 8f31d28b33b20faa55231275099e3459bce1f979..36241b460a044bf69851e5ffb8c079a31a612f7a 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md @@ -24,18 +24,18 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () => void, aut | gridCount8+ | number | 否 | - | 弹窗宽度占栅格宽度的个数。 | ## DialogAlignment枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Top | 垂直顶部对齐。 | - | Center | 垂直居中对齐。 | - | Bottom | 垂直底部对齐。 | - | Default | 默认对齐。 | - | TopStart8+ | 左上对齐。 | - | TopEnd8+ | 右上对齐。 | - | CenterStart8+ | 左中对齐。 | - | CenterEnd8+ | 右中对齐。 | - | BottomStart8+ | 左下对齐。 | - | BottomEnd8+ | 右下对齐。 | +| 名称 | 描述 | +| -------- | -------- | +| Top | 垂直顶部对齐。 | +| Center | 垂直居中对齐。 | +| Bottom | 垂直底部对齐。 | +| Default | 默认对齐。
**说明:**
与枚举值Center效果相同。 | +| TopStart8+ | 左上对齐。 | +| TopEnd8+ | 右上对齐。 | +| CenterStart8+ | 左中对齐。 | +| CenterEnd8+ | 右中对齐。 | +| BottomStart8+ | 左下对齐。 | +| BottomEnd8+ | 右下对齐。 | ## CustomDialogController diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-timepicker-dialog.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-timepicker-dialog.md index 36933274c9dfcf07464e1d8d13c8b4fb81a4a10e..0d0f378076512d41dfb2910f018d44f6f7bc7548 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-timepicker-dialog.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-timepicker-dialog.md @@ -12,13 +12,13 @@ show(options?: TimePickerDialogOptions) 定义时间滑动选择器弹窗并弹出。 - options参数 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | -------- | -------- | -------- | - | selected | Date | 否 | 当前系统时间 | 设置选中项的时间。 | - | useMilitaryTime | boolean | 否 | false | 展示时间是否为24小时制。 | - | onAccept | (value: [TimePickerResult](ts-basic-components-timepicker.md#TimePickerResult对象说明)) => void | 否 | - | 点击弹窗中确定按钮时触发。 | - | onCancel | () => void | 否 | - | 点击弹窗中取消按钮时触发。 | - | onChange | (value: [TimePickerResult](ts-basic-components-timepicker.md#TimePickerResult对象说明)) => void | 否 | - | 滑动选择器,当前选择项改变时触发。 | + | 参数名 | 参数类型 | 必填 | 参数描述 | + | -------- | -------- | -------- | -------- | + | selected | Date | 否 | 设置选中项的时间。
默认值:当前系统时间 | + | useMilitaryTime | boolean | 否 | 展示时间是否为24小时制。
默认值:false | + | onAccept | (value: [TimePickerResult](ts-basic-components-timepicker.md#TimePickerResult对象说明)) => void | 否 | 点击弹窗中确定按钮时触发。 | + | onCancel | () => void | 否 | 点击弹窗中取消按钮时触发。 | + | onChange | (value: [TimePickerResult](ts-basic-components-timepicker.md#TimePickerResult对象说明)) => void | 否 | 滑动选择器,当前选择项改变时触发。 | ## 示例 diff --git a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001118642023.gif b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001118642023.gif new file mode 100644 index 0000000000000000000000000000000000000000..c584f3fddad26c473453a573a12f6aa869d2cdbc Binary files /dev/null and b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001118642023.gif differ diff --git a/zh-cn/application-dev/ui/ts-component-creation-re-initialization.md b/zh-cn/application-dev/ui/ts-component-creation-re-initialization.md index 1786a365cb4098141f02e8a0f9c2a79993abd91b..f45dd97155727e4159eddafb8da752c8e073b469 100644 --- a/zh-cn/application-dev/ui/ts-component-creation-re-initialization.md +++ b/zh-cn/application-dev/ui/ts-component-creation-re-initialization.md @@ -55,10 +55,10 @@ struct ParentComp { Column() { Text(this.isCountDown ? 'Count Down' : 'Stopwatch') if (this.isCountDown) { - Image('countdown.png') + Image($r("app.media.countdown")).width(200).height(200) TimerComponent({counter: 10, changePerSec: -1, showInColor: Color.Red}) } else { - Image('stopwatch.png') + Image($r("app.media.stopwatch")).width(200).height(200) TimerComponent({counter: 0, changePerSec: +1, showInColor: Color.Black }) } Button(this.isCountDown ? 'Switch to Stopwatch' : 'Switch to Count Down') @@ -92,3 +92,5 @@ struct TimerComponent { } } ``` + + ![](figures/zh-cn_image_0000001118642023.gif) \ No newline at end of file