@Entry
@Component
struct Index {
@State widthA: number = 200
@State heightA: number= 200
@State angleA:number = 0
onPageShow():void{
animateTo ( {
duration: 2000,
iterations: -1,
curve:Curve.Linear
}, () => {
this.widthA = 0
this.heightA = 0
this.angleA = 360
} )
}
build() {
Column() {
// 中心旋转
Column(){}
.width(200)
.height(200)
.backgroundColor('#ffc44f4f')
.rotate({
x: 0,
y: 0,
z: 1,
angle: this.angleA,
centerX:100,
centerY:100,
})
Text('中心旋转')
.fontSize(20)
.fontWeight(FontWeight.Bold)
鸿蒙 HarmonyOS ArkTS ArkUI 动画 中心旋转、空翻、旋转缩放
于 2024-01-21 15:16:39 首次发布