简体   繁体   English

多点触控/ Android时,Sencha Touch App冻结

[英]Sencha Touch App freeze when multitouch / Android

I built a sencha touch (2.1.0) app and tested it on my Samsung Galaxy S2 (Android 4.0.3). 我构建了一个sencha touch(2.1.0)应用程序,并在我的Samsung Galaxy S2(Android 4.0.3)上对其进行了测试。 Once I did that with the native build command of snecha cmd and another I wrapped it with phonegap. 一旦我使用snecha cmd的本机构建命令执行了此操作,另一个命令我用phonegap进行了包装。 Both times I've got a freeze when I touch the screen with two fingers at the same time. 两次我同时用两根手指触摸屏幕时都死机了。 I cannot press a button or scroll anymore. 我无法再按按钮或滚动。

Has anyone a solution for that problem? 有没有人解决这个问题?

I also read the post in the Sencha forum ( http://www.sencha.com/forum/showthread.php?249581-Multi-touch-and-phonegap ), but that did not work for me or I'm doing something wrong. 我还在Sencha论坛( http://www.sencha.com/forum/showthread.php?249581-Multi-touch-and-phonegap )上阅读了该帖子,但这对我不起作用或我正在做某事错误。

Any help would be appreciable. 任何帮助将是可观的。


I recently came across this problem and visited the Sencha Forum link you mentioned and implemented it in my code which achieve the following. 我最近遇到了这个问题,并访问了您提到的Sencha论坛链接,并在我的代码中实现了该链接,从而实现了以下目的。
1. With the fix incorporated app will never freeze with simultaneous tap. 1.结合了此修复程序后,同时点击不会冻结。
2. You will have to tap somewhere on the screen one more time, after you simultaneously tapped at two or more points earlier. 2.在您同时提前敲击两个或多个点之后,您将不得不再点击一次屏幕上的某个位置。

Note: The issue is reproducible only with android 4.0.x and Sencha 2.1. 注意:仅在android 4.0.x和Sencha 2.1上可以重现此问题。

A big thanks to TROELS from Sencha Forum 非常感谢Sencha论坛的TROELS
In your app.js place the if condition outside your Ext.application as shown below 在您的app.js中,将if条件放在Ext.application外部,如下所示


Ext.application({
    name:xyz
    requires:[abc]
    //other stuffs
    });

    if(Ext.os.is.Android && Ext.os.version.equals(4.0)) {

        Ext.define('app.overrides.TouchGesture', {
            override: 'Ext.event.publisher.TouchGesture',

            reset: function(e){
                if(Ext.os.version.equals(4.0) && this.currentTouchesCount > 0){
                    e.changedTouches = Ext.Object.getValues(this.currentTouches);
                    this.onTouchEnd(e);
                }
            }
        });


            window.orgPinchEndMethod = Ext.event.recognizer.Pinch.prototype.end;
            Ext.define('app.overrides.Pinch', {
            override: 'Ext.event.recognizer.Pinch',

            end: function(e){
            var wasTracking = this.isTracking,
            result = window.orgPinchEndMethod.apply(this, arguments);
            if(wasTracking){
                this._resetDetection(e);
            }
            return result;
        },

            _resetDetection: function(e){
                var tg = Ext.event.Dispatcher.getInstance().getPublishers().touchGesture;
                setTimeout(function(){
                    tg.reset(e);
                }, 0);
            }
           });

     }



声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM