应该是组合手势和rotate冲突,可以在image外面套一层父组件参考下面demo:build() { Column() { Text('标题栏') .width('100%') .height(50) .textAlign(TextAlign.Center) Column(){ Image($r('app.media.img')) .width(200) .height(200) .scale({ x: this.scaleValue, y: this.scaleValue, z: 1 }) .translate({ x: this.offsetX, y: this.offsetY, z: 0 }) .rotate({ angle: this.angle, }) }.gesture(GestureGroup(GestureMode.Parallel, PanGesture() .onActionUpdate((event: GestureEvent) => { if (event) { this.offsetX = this.positionX + event.offsetX this.offsetY = this.positionY + event.offsetY } }) .onActionEnd(() => { this.positionX = this.offsetX this.positionY = this.offsetY console.info('Pan end') }), RotationGesture() .onActionUpdate((event: GestureEvent) => { if (event) { this.angle = this.rotateValue + event.angle } }) .onActionEnd((event: GestureEvent) => { this.rotateValue = this.angle console.info('Rotation end') }) ) ) } }
应该是组合手势和rotate冲突,可以在image外面套一层父组件参考下面demo: