<
Harmony 手势响应 双指缩放
>
上一篇

Harmony 三方库 整理
下一篇

Harmony android ios 与 javascript 互调

Harmony 手势响应 双指缩放

.priorityGesture(
  PinchGesture()
    .onActionEnd((event: GestureEvent) => {
      console.info('end scale:' + event.scale)
      // 手指分开,减少列数以放大item,触发阈值可以自定义,示例为2
      if (event.scale > 2) {
        // 放大
		
      } else if (event.scale < 0.6) {
        // 缩小
		
      }
      
    })
)

参考 示例

https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-container-waterflow-V5#%E7%A4%BA%E4%BE%8B4

Top
Foot