50
社区成员




根据官方文档
var arcProgress = hmUI.createWidget(hmUI.widget.ARC_PROGRESS)
arcProgress.setProperty(hmUI.prop.MORE, {
center_x: 195,
center_y: 256,
radius: 171,
start_angle: 0,
end_angle: 360,
color: 0xc08eaf,
line_width: 45,
level: progress
})
实现创建一个弧形进度条
这时你想更新UI,根据官方文档更新UI.
arcProgress.setProperty(hmUI.prop.MORE, {
center_x: 195,
center_y: 256,
radius: 171,
start_angle: 0,
end_angle: 360,
color: 0xc08eaf,
line_width: 45,
level: progress
})
但如果无法更新,建议删除UI后重新创建实现.
hmUI.deleteWidget(arcProgress)
arcProgress = hmUI.createWidget(hmUI.widget.ARC_PROGRESS)
arcProgress.setProperty(hmUI.prop.MORE, {
center_x: 195,
center_y: 256,
radius: 171,
start_angle: 0,
end_angle: 360,
color: 0xc08eaf,
line_width: 45,
level: progress
})
!
ok