1 Star 0 Fork 5.2K

OpenHarmony-build / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ts-basic-components-progress.md 10.03 KB
一键复制 编辑 原始数据 按行查看 历史
zengyawen 提交于 2021-11-10 20:02 . add arkui

Progress

进度条,用于显示内容加载或操作处理进度。

支持设备

手机

平板

车机

智慧屏

智能穿戴

支持

支持

支持

不支持

不支持

子组件

接口说明

Progress(value: {value: number, total?: number, style?: ProgressStyle})

创建有明确进度的进度条。

  • 参数

    参数名

    参数类型

    必填

    默认值

    参数描述

    value

    number

    -

    指定当前进度值。

    total

    number

    100

    指定进度总长。

    style

    ProgressStyle

    Linear

    指定进度条样式。

  • ProgressStyle枚举说明

    名称

    描述

    Linear

    线性进度条样式。

属性

名称

参数类型

默认值

描述

value

number

-

设置当前进度值。

color

Color

-

设置进度条前景色。

示例

@Entry
@Component
struct ProgressExample {
  build() {
    Column({ space: 5 }) {
      Text('Linear Progress').fontSize(9).fontColor(0xCCCCCC).width('90%')
      Progress({ value: 10, style: ProgressStyle.Linear }).width(200)

      Text('Linear Progress Color').fontSize(9).fontColor(0xCCCCCC).width('90%')
      Progress({ value: 20, total: 150, style: ProgressStyle.Linear }).color(Color.Red).value(50).width(200)
    }.width('100%').margin({ top: 5 })
  }
}

1
https://gitee.com/openharmony-build/docs.git
git@gitee.com:openharmony-build/docs.git
openharmony-build
docs
docs
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891