可参考示例如下:import { curves } from '@kit.ArkUI' @Entry @Component struct Page030 { @State rotateValue: number = 0 build() { Column() { Button('测试').onClick(() => { this.rotateValue = 360 }) Image($r("app.media.app_icon")) .width('200lpx') .height('200lpx') .rotate({ angle: this.rotateValue }) .animation(this.rotateValue != 0 ? { duration: 2000, curve: curves.springMotion(), playMode: PlayMode.Normal, onFinish: (() => { console.info('----onFinish this.rotateValue', this.rotateValue) if (this.rotateValue == 360) { this.rotateValue = 0 } }) } : undefined) } .width('100%') .height('100%') } }
可参考示例如下: