未验证 提交 a1edfc6f 编写于 作者: 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>
上级 322c55e2
...@@ -61,7 +61,7 @@ Text(content?: string | Resource) ...@@ -61,7 +61,7 @@ Text(content?: string | Resource)
## 示例 ## 示例
### 示例1 ### 示例1
textAlign,textOverflow,maxLines,lineHeight使用示例。
```ts ```ts
// xxx.ets // xxx.ets
@Entry @Entry
...@@ -144,7 +144,7 @@ struct TextExample1 { ...@@ -144,7 +144,7 @@ struct TextExample1 {
![textExp1](figures/textExp1.png) ![textExp1](figures/textExp1.png)
### 示例2 ### 示例2
decoration,baselineOffset,letterSpacing,textCase使用示例:
```ts ```ts
@Entry @Entry
@Component @Component
...@@ -253,14 +253,13 @@ struct TextExample2 { ...@@ -253,14 +253,13 @@ struct TextExample2 {
### 示例3 ### 示例3
textShadow,heightAdaptivePolicy,TextOverflow.MARQUEE使用示例:
```ts ```ts
@Entry @Entry
@Component @Component
struct TextExample { struct TextExample {
build() { build() {
Column({ space: 8 }) { Column({ space: 8 }) {
// 设置文字阴影效果
Text('textShadow').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%') Text('textShadow').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%')
Text('textShadow') Text('textShadow')
.width('80%') .width('80%')
...@@ -271,6 +270,7 @@ struct TextExample { ...@@ -271,6 +270,7 @@ struct TextExample {
.textShadow({ radius: 10, color: Color.Black, offsetX: 0, offsetY: 0 }) .textShadow({ radius: 10, color: Color.Black, offsetX: 0, offsetY: 0 })
.borderWidth(1) .borderWidth(1)
Divider() Divider()
// 设置文本自适应高度的方式
Text('heightAdaptivePolicy').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%') Text('heightAdaptivePolicy').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%')
Text('This is the text with the height adaptive policy set') Text('This is the text with the height adaptive policy set')
.width('80%') .width('80%')
...@@ -300,6 +300,7 @@ struct TextExample { ...@@ -300,6 +300,7 @@ struct TextExample {
.textOverflow({ overflow: TextOverflow.Ellipsis }) .textOverflow({ overflow: TextOverflow.Ellipsis })
.heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST)
Divider() Divider()
// 设置文本超长时以跑马灯的方式展示
Text('marquee').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%') Text('marquee').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%')
Text('This is the text with the text overflow set marquee') Text('This is the text with the text overflow set marquee')
.width(300) .width(300)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册