Rect
绘制矩形、圆角矩形。
继承
Rect > UI
关键属性
width: number
宽度。
height: number
高度。
圆角属性
cornerRadius: number
| number
[]
圆角大小,可以分别设置 4 个圆角。
ts
cornerRadius: [20, 10, 20, 10] // [topLeft, topRight, bottomRight, bottomLeft]
cornerRadius: [20, 10, 20] // [topLeft, (topRight-bottomLeft), bottomRight]
cornerRadius: [20, 10] // [ (topLeft-bottomRight), (topRight-bottomLeft)]
cornerRadius: 20 // all
示例
绘制矩形
ts
绘制圆角矩形
ts