HarmonyOS/OpenHarmony meta-service development - card use animation ability

ArkTS cards open up the ability to use animation effects, and support explicit animation, property animation, and transition capabilities within components. It should be noted that ArkTS cards have the following limitations when using animation effects:
 

HarmonyOS/OpenHarmony meta-service development-card use dynamic effect-open source basic software community


The following sample code implements the animation effect of button rotation:

HarmonyOS/OpenHarmony meta-service development-card use dynamic effect-open source basic software community

@Entry
@Component
struct AttrAnimationExample {
@State rotateAngle: number = 0;

build() {
Column() {
Button('change rotate angle')
.onClick(() => {
this.rotateAngle = 90;
})
.margin(50)
.rotate({ angle: this.rotateAngle })
.animation({
curve: Curve.EaseOut,
playMode: PlayMode.AlternateReverse
})
}.width('100%').margin({ top: 20 })
}
}

Guess you like

Origin blog.csdn.net/weixin_69135651/article/details/131984856