Skip to main content
版本:v1.0

STROKE_RECT

stroke_rect_sample

描边矩形控件在填充矩形控件的基础上加入了描边。

创建 UI 控件​

const strokeRect = hmUI.createWidget(hmUI.widget.STROKE_RECT, Param)

类型​

Param: object​

属性备注是否必须类型
x控件 x 坐标是number
y控件 y 坐标是number
w控件显示宽度是number
h控件显示高度是number
color控件颜色是number
radius矩形圆角否number
line_width描边宽度否number
angle旋转角度否number

代码示例​

Page({
build() {
const strokeRect = hmUI.createWidget(hmUI.widget.STROKE_RECT, {
x: 125,
y: 125,
w: 230,
h: 150,
radius: 20,
line_width: 4,
color: 0xfc6950
})

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