【问题标题】:Giving immediate feedback upon touching a touch screen在触摸触摸屏时提供即时反馈
【发布时间】:2014-01-16 03:39:05
【问题描述】:

我们正在使用 AngularJS、Bootstrap 和 Phonegap 来构建一个主要针对 iPad 的应用程序。到目前为止,我们一直在使用 Bootstrap list-group-item 类。我们发现,在触摸定义如下所示的视觉元素时,在用户触摸元素和接收到发生某事的视觉反馈之间可能存在半秒的延迟。有没有办法对此进行编码,以便用户在处理点击事件之前立即获得反馈 - 例如突出显示该区域?提供即时反馈会在应用程序的响应能力方面产生显着的感知变化。

<a class="list-group-item" ng-click="studentSelectClick(student.student_info.userId)">
    <span ng-bind-template="{{student.student_info.firstName}}
                            {{student.student_info.lastName}}">
    </span>
</a>

【问题讨论】:

    标签: html angularjs cordova angularjs-directive


    【解决方案1】:

    Angular 提供了一个模块,ngTouch 来解决这个由某些触摸设备引起的问题。根据http://docs.angularjs.org/api/ngTouch 的文档,您应该能够将其包含在页面中:

    <script src="angular.js">
    <script src="angular-touch.js">
    

    然后通过以下方式包含对模块的依赖:

    angular.module('app', ['ngTouch']);
    

    【讨论】:

      【解决方案2】:

      这是由于移动浏览器如何处理点击。有两种选择:

      1. 使用fastclick
      2. 将浏览器视口设置为没有用户可伸缩性。请参阅 here,但请注意,它在移动 Safari 中不起作用——您最终可能不得不使用 fastclick。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-09-06
        • 1970-01-01
        • 2014-09-10
        • 2023-03-09
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多