未验证 提交 0e529729 编写于 作者: L LiAn 提交者: Gitee

update zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md.

Signed-off-by: NLiAn <lian15@huawei.com>
Signed-off-by: NLiAn <lian15@huawei.com>
上级 1d8ee308
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册