Skip to main content
版本:v1.0

ARC

arc_sample

圆弧控件展示圆弧进度。支持设置线宽、颜色、开始和结束的角度。

创建 UI 控件​

const arc = hmUI.createWidget(hmUI.widget.ARC, Param)

类型​

Param: object​

属性说明是否必须类型
x控件 x 坐标是number
y控件 y 坐标是number
w控件显示宽度是number
h控件显示高度是number
start_angle开始角度(3 点钟方向为 0 度)否number
end_angle结束角度(3 点钟方向为 0 度)否number
line_width线宽是number
color颜色是number

代码示例​

Page({
build() {
const arc = hmUI.createWidget(hmUI.widget.ARC, {
x: 100,
y: 100,
w: 250,
h: 250,
start_angle: -90,
end_angle: 90,
color: 0xfc6950,
line_width: 20
})

arc.addEventListener(hmUI.event.CLICK_DOWN, (info) => {
arc.setProperty(hmUI.prop.MORE, {
y: 150
})
})
}
})