From ee306b5a180148a777e231fbb2216d5256c19315 Mon Sep 17 00:00:00 2001 From: acton393 Date: Tue, 6 Mar 2018 21:50:57 +0800 Subject: [PATCH] [doc] add force property and add examples --- source/cn/wiki/gestures.md | 6 +++++- source/wiki/gestures.md | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/source/cn/wiki/gestures.md b/source/cn/wiki/gestures.md index 1d2c20777..c3f551dcc 100644 --- a/source/cn/wiki/gestures.md +++ b/source/cn/wiki/gestures.md @@ -10,7 +10,7 @@ version: 2.1 *注:该功能属于实验性功能* -Weex 封装了原生的触摸事件以提供手势系统。使用手势类似于在 Weex 中使用事件,只需在节点上设置 `on` 特性来监听手势即可。 +Weex 封装了原生的触摸事件以提供手势系统。使用手势类似于在 Weex 中使用事件,只需在节点上监听手势即可。 ## 手势类型 @@ -56,6 +56,10 @@ Weex 封装了原生的触摸事件以提供手势系统。使用手势类似于 - `pageY`:触摸点相对于文档顶部边缘的 Y 轴坐标。 - `screenX`:触摸点相对于屏幕左侧边缘的 X 轴坐标。 - `screenY`:触摸点相对于屏幕顶部边缘的 Y 轴坐标。 +- `force`: 屏幕收到的按压力度,值的范围为 0~1 +>>> force 属性目前在支持 forceTouch iOS 设备才支持, iPhone 6s 及更新的 iOS 设备 + +[试一试](http://dotwe.org/vue/91b6929f4f9f97a099a30c516dc2db06) ## 约束 diff --git a/source/wiki/gestures.md b/source/wiki/gestures.md index cb3cb697b..9e0f7b3b3 100644 --- a/source/wiki/gestures.md +++ b/source/wiki/gestures.md @@ -10,7 +10,7 @@ version: 2.1 > Experiment Feature -Weex encapsulates native touch events to provide a gesture system. Using gesture is similar to use event in Weex. Just set `on` attributes on a node to listen to gesture. +Weex encapsulates native touch events to provide a gesture system. Using gesture is similar to use event in Weex. ## Type For now, there are four types of gestures: @@ -52,6 +52,10 @@ The following properties can be used in gesture callback: * `pageY`. The Y coordinate of the touch pointer relative to the top of the document. * `screenX`. The X coordinate of the touch point relative to the left edge of the screen. * `screenY`. The Y coordinate of the touch point relative to the top edge of the screen. +* `force`. A float value that represents the amount of pressure the user is applying to the touch surface. This is a value between 0.0 (no pressure) and 1.0 (the maximum amount of pressure the hardware can recognize). +>>> iOS only and force is included in iPhone 6S and later models + +[have a try](http://dotwe.org/vue/91b6929f4f9f97a099a30c516dc2db06) ## Constrain Currently, Weex Android do not support listening to gesture on `scroller`, `list` and `webview`, as it would lead a large amount of event conflicting.