提交 0e6fdf98 编写于 作者: L luoying_ace

fixed 28f05f8b from https://gitee.com/luoying_ace_admin/docs/pulls/10197

update zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md.
Signed-off-by: Nluoying_ace <luoying19@huawei.com>
上级 6de162ca
...@@ -58,19 +58,30 @@ Rect(value?: {width?: string | number,height?: string | number,radius?: string | ...@@ -58,19 +58,30 @@ Rect(value?: {width?: string | number,height?: string | number,radius?: string |
@Component @Component
struct RectExample { struct RectExample {
build() { build() {
Column({ space: 5 }) { Column({ space: 10 }) {
Text('normal').fontSize(9).fontColor(0xCCCCCC).width('90%') Text('normal').fontSize(11).fontColor(0xCCCCCC).width('90%')
// 绘制90% * 50矩形 // 绘制90% * 50矩形
Rect({ width: '90%', height: 50 }) Rect({ width: '90%', height: 50 })
// 绘制90% * 50矩形 .fill(Color.Pink)
Rect().width('90%').height(50) // 绘制90% * 50的矩形框
Rect()
Text('with rounded corners').fontSize(9).fontColor(0xCCCCCC).width('90%') .width('90%')
// 绘制90% * 50矩形, 圆角宽高20 .height(50)
Rect({ width: '90%', height: 50 }).radiusHeight(20).radiusWidth(20) .fillOpacity(0)
// 绘制90% * 50矩形, 圆角宽高20 .stroke(Color.Red)
Rect({ width: '90%', height: 50 }).radius(20) .strokeWidth(3)
}.width('100%').margin({ top: 5 })
Text('with rounded corners').fontSize(11).fontColor(0xCCCCCC).width('90%')
// 绘制90% * 80的矩形, 圆角宽高分别为40、20
Rect({ width: '90%', height: 80 })
.radiusHeight(20)
.radiusWidth(40)
.fill(Color.Pink)
// 绘制90% * 80的矩形, 圆角宽高为20
Rect({ width: '90%', height: 80 })
.radius(20)
.fill(Color.Pink)
}.width('100%').margin({ top: 10 })
} }
} }
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册