ARC
Arc widget to display arc progress. Support setting line width, color, start and end angle.
Create UI widget
const arc = hmUI.createWidget(hmUI.widget.ARC, Param)
Type
Param: object
Properties | Description | Required | Type |
---|---|---|---|
x | The x-coordinate of components | YES | number |
y | The y-coordinate of components | YES | number |
w | The width of components | YES | number |
h | The height of components | YES | number |
radius | Radius | YES | number |
start_angle | The angle at the beginning of the arc. (0 degrees is the positive three o'clock direction) | YES | number |
end_angle | The angle at the end of the arc. (0 degrees is the positive three o'clock direction) | YES | number |
line_width | Width of circular arc. | YES | number |
color | Color of circular arc. | YES | number |
Code example
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
})
})
}
})