Skip to main content
Version: 3.x

ScaleGestureHandler

多指缩放时触发手势 微信小程序下 skyline 的手势标签,只能在 CompileMode 中使用

支持情况:

类型​

ComponentType<ScaleGestureHandlerProps>

示例代码​

import { Component } from 'react'
import { View, ScaleGestureHandler } from '@tarojs/components'

export function Index () {
return (
<View compileMode>
<ScaleGestureHandler onGestureWorklet="onGesture">
<View className='circle'></View>
</ScaleGestureHandler>
</View>
)
}

ScaleGestureHandlerProps​

参数类型必填说明
tagstring否声明手势协商时的组件标识
onGestureWorkletstring否手势识别成功的回调
shouldResponseOnMoveWorkletstring否手指移动过程中手势是否响应
shouldAcceptGestureWorkletstring否手势是否应该被识别
simultaneousHandlersstring[]否声明可同时触发的手势节点
nativeViewstring否代理的原生节点类型

API 支持度​

API微信小程序H5React NativeHarmony
ScaleGestureHandlerProps.tag✔️
ScaleGestureHandlerProps.onGestureWorklet✔️
ScaleGestureHandlerProps.shouldResponseOnMoveWorklet✔️
ScaleGestureHandlerProps.shouldAcceptGestureWorklet✔️
ScaleGestureHandlerProps.simultaneousHandlers✔️
ScaleGestureHandlerProps.nativeView✔️