我会使用 DevEco 死丢丢,使用 ArkTS 写
看我现场给你写一个!
@Entry
@Component
struct JueQi {
@State isJueQi: boolean = false;
build() {
Column({space:20}){
if(this.isJueQi){
Image($r('app.media.鸿蒙崛起了'))
.height(300)
.width(300)
}else{
Image($r('app.media.隐忍中'))
.height(300)
.width(300)
}
Row({space:20}){
Button('崛起')
.onClick(()=>this.isJueQi = true
)
.backgroundColor(Color.Green)
Button('隐忍')
.onClick(()=>this.isJueQi = false)
.backgroundColor(Color.Red)
}
}
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Center)
}
}
万事俱备,只差一台