From 31e61f1a8c460e6f32851391973d23a08ee9159d Mon Sep 17 00:00:00 2001 From: luoying_ace Date: Tue, 27 Sep 2022 13:19:12 +0000 Subject: [PATCH] update zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md. Signed-off-by: luoying_ace --- .../arkui-ts/ts-drawing-components-line.md | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md index 99d75d06f4..402ee63e59 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md @@ -59,11 +59,29 @@ Line(value?: {width?: string | number, height?: string | number}) @Component struct LineExample { build() { - Column() { - Line().startPoint([0, 0]).endPoint([50, 100]) - Line({ width: 50, height: 50 }).startPoint([0, 0]).endPoint([100, 100]) - Line().width(200).height(200).startPoint([50, 50]).endPoint([150, 150]) - }.margin({ top: 5 }) + Column({ space: 10 }) { + // 线条绘制的起止点坐标均是相对于Line组件本身绘制区域的坐标 + Line() + .startPoint([0, 0]) + .endPoint([50, 100]) + .backgroundColor('#F5F5F5') + Line() + .width(200) + .height(200) + .startPoint([50, 50]) + .endPoint([150, 150]) + .strokeWidth(5) + .stroke(Color.Orange) + .strokeOpacity(0.5) + .backgroundColor('#F5F5F5') + // 当坐标点设置的值超出Line组件的宽高范围时,线条会画出组件绘制区域 + Line({ width: 50, height: 50 }) + .startPoint([0, 0]) + .endPoint([100, 100]) + .strokeWidth(3) + .strokeDashArray([1, 3]) + .backgroundColor('#F5F5F5') + } } } ``` -- GitLab