.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