未验证 提交 bc24746b 编写于 作者: O openharmony_ci 提交者: Gitee

!20742 【Button】新增接口在文档中体现

Merge pull request !20742 from sunjiakun/ButtonDoc
...@@ -168,4 +168,42 @@ struct SwipeGestureExample { ...@@ -168,4 +168,42 @@ struct SwipeGestureExample {
} }
``` ```
![ifButton](figures/ifButton.gif) ![ifButton](figures/ifButton.gif)
\ No newline at end of file
### 示例3
```ts
// xxx.ets
@Entry
@Component
struct buttonTestDemo {
@State txt: string = 'overflowTextOverlengthTextOverflow.Clip';
@State widthShortSize: number = 200;
build() {
Row() {
Column() {
Button(this.txt)
.width(this.widthShortSize)
.height(100)
.labelStyle({ overflow: TextOverflow.Clip,
maxLines: 1,
minFontSize: 20,
maxFontSize: 20,
font: {
size: 20,
weight: FontWeight.Bolder,
family: 'cursive',
style: FontStyle.Italic
}
})
.fontSize(40)
}
.width('100%')
}
.height('100%')
}
}
```
![image-20230711171138661](figures/imageButtonLabelStyle.png)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册