diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-gesture-settings.md b/zh-cn/application-dev/reference/arkui-ts/ts-gesture-settings.md index 498690dcb00b9e93dc70ccd04d26e5b7ecdf5486..fdef9d46a0c9f85b3922ab5f01dcfc0cf68d4cd5 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-gesture-settings.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-gesture-settings.md @@ -1,6 +1,6 @@ # 绑定手势方法 -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> **说明:** > 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 @@ -18,26 +18,27 @@ | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | | gesture | gesture: GestureType,
mask?: GestureMask | gesture: -,
mask: GestureMask.Normal | 绑定手势识别。
gesture: 绑定的手势类型, mask: 事件响应设置。 | -| priorityGesture | gesture: GestureType,
mask?: GestureMask | gesture: -,
mask: GestureMask.Normal | 绑定优先识别手势。
gesture: 绑定的手势类型, mask: 事件响应设置。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> - 默认情况下,子组件优先于父组件识别手势,当父组件配置priorityGesture时,父组件优先于子组件进行识别。 | -| parallelGesture | gesture: GestureType,
mask?: GestureMask | gesture: -,
mask: GestureMask.Normal | 绑定可与子组件手势同时触发的手势。
gesture: 绑定的手势类型, mask: 事件响应设置。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> - 手势事件为非冒泡事件。父组件设置parallelGesture时,父子组件相同的手势事件都可以触发,实现类似冒泡效果。 | +| priorityGesture | gesture: GestureType,
mask?: GestureMask | gesture: -,
mask: GestureMask.Normal | 绑定优先识别手势。
gesture: 绑定的手势类型, mask: 事件响应设置。
默认情况下,子组件优先于父组件识别手势,当父组件配置priorityGesture时,父组件优先于子组件进行识别。 | +| parallelGesture | gesture: GestureType,
mask?: GestureMask | gesture: -,
mask: GestureMask.Normal | 绑定可与子组件手势同时触发的手势。
gesture: 绑定的手势类型, mask: 事件响应设置。
手势事件为非冒泡事件。父组件设置parallelGesture时,父子组件相同的手势事件都可以触发,实现类似冒泡效果。 | - GestureMask枚举说明 - | 名称 | 描述 | + | 名称 | 描述 | | -------- | -------- | - | Normal | 不屏蔽子组件的手势,按照默认手势识别顺序进行识别。 | - | IgnoreInternal | 屏蔽子组件的手势,仅当前容器的手势进行识别。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 子组件上系统内置的手势不会被屏蔽,如子组件为List组件时,内置的滑动手势仍然会触发。 | + | Normal | 不屏蔽子组件的手势,按照默认手势识别顺序进行识别。 | + | IgnoreInternal | 屏蔽子组件的手势,仅当前容器的手势进行识别。
子组件上系统内置的手势不会被屏蔽,如子组件为List组件时,内置的滑动手势仍然会触发。 | - GestureType - | 名称 | 描述 | + | 名称 | 描述 | | -------- | -------- | - | TapGesture | 点击手势,支持单次点击、多次点击识别。 | - | LongPressGesture | 长按手势。 | - | PanGesture | 平移手势。 | - | PinchGesture | 捏合手势。 | - | RotationGesture | 旋转手势。 | - | GestureGroup | 手势识别组,多种手势组合为复合手势,支持连续识别、并行识别和互斥识别。 | + | TapGesture | 点击手势,支持单次点击、多次点击识别。 | + | LongPressGesture | 长按手势。 | + | PanGesture | 平移手势,滑动最小距离为5vp时识别成功。 | + | PinchGesture | 捏合手势。 | + | RotationGesture | 旋转手势。 | + | SwipeGesture | 滑动手势,滑动最小速度为100vp/s时识别成功。 | + | GestureGroup | 手势识别组,多种手势组合为复合手势,支持连续识别、并行识别和互斥识别。 | ## 响应手势事件 @@ -45,9 +46,9 @@ 组件通过gesture方法绑定手势对象,可以通过手势对象提供的事件相应响应手势操作。如通过TapGesture对象的onAction事件响应点击事件。具体事件定义见各个手势对象章节。 - TapGesture事件说明 - | 名称 | 功能描述 | + | 名称 | 功能描述 | | -------- | -------- | - | onAction((event?:GestureEvent) => void) | Tap手势识别成功回调。 | + | onAction((event?:GestureEvent) => void) | Tap手势识别成功回调。 | - GestureEvent对象说明 | 属性名称 | 属性类型 | 描述 | @@ -58,7 +59,8 @@ ## 示例 -``` +```ts +// xxx.ets @Entry @Component struct GestureSettingsExample {