界面有增大字体按钮,每次点击增大字体按钮,“Hello ArkTS”都会变大
@Entry
@Component
struct Page {
textValue: string = 'Hello ArkTS'
@State textSize: number = 50
myClick():void{
this.textSize += 4
}
build() {
Row() {
Column() {
// @ts-ignore
Text(this.textValue)
.fontSize(this.textSize)
.fontWeight(FontWeight.Bold)
.fontColor(Color.Red)
Button("点击增大哦")
.height(50)
.width(100)
.margin({top:20})
.onClick(this.myClick.bind(this))
}
.width('100%')
}
.height('100%')
}
}