【发布时间】:2014-10-02 14:52:44
【问题描述】:
在 ionic 应用程序中,我正在观看 on-swipe-right 指令以实现“返回”功能。
doctype html5
html(lang='en', ng-app='my-app')
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1')
meta(name='viewport', content='width=device-width,initial-scale=1')
//- snip
body(
ng-controller="DoloresMainCtrl"
on-swipe-right="toMainScreen($event)"
)
ion-nav-view
在控制器中
angular.module('my-app', [
'ui.router'
])
.controller 'DoloresMainCtrl', ($scope, $state)->
$scope.toMainScreen = ($event)->
$state.go '^' if $event?.gesture?.touches?.length is 2
事件触发得很好,但$event.gesture.touches.length 始终是1。
我需要设置什么来让 ionic 检测多个触摸?
(约束:Android 4.4+、iOS 8+)
【问题讨论】:
-
我也对这个问题的答案感兴趣。 Ionic 使用了一个hammer.js 的fork 来处理触摸事件,而在hammer.js 中可以检测到多个触摸,那么为什么不在Ionic 中呢?
标签: android ios angularjs touch ionic-framework