diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md index 31ae79e889469e220e7e381df209d43fc5b777a8..315444a62133e9399a6c837bc461e5c52cd4ef1b 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md @@ -61,7 +61,7 @@ Text(content?: string | Resource) ## 示例 ### 示例1 -textAlign,textOverflow,maxLines,lineHeight使用示例。 + ```ts // xxx.ets @Entry @@ -144,7 +144,7 @@ struct TextExample1 { ![textExp1](figures/textExp1.png) ### 示例2 -decoration,baselineOffset,letterSpacing,textCase使用示例: + ```ts @Entry @Component @@ -262,6 +262,7 @@ struct TextExample { build() { Column({ space: 8 }) { Text('textShadow').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%') + // 设置文字阴影效果 Text('textShadow') .width('80%') .height(55) @@ -271,6 +272,7 @@ struct TextExample { .textShadow({ radius: 10, color: Color.Black, offsetX: 0, offsetY: 0 }) .borderWidth(1) Divider() + // 设置文本自适应高度的方式 Text('heightAdaptivePolicy').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%') Text('This is the text with the height adaptive policy set') .width('80%') @@ -301,6 +303,7 @@ struct TextExample { .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) Divider() Text('marquee').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%') + // 设置文本超长时以跑马灯的方式展示 Text('This is the text with the text overflow set marquee') .width(300) .borderWidth(1)