[Phonegap+Sencha Touch] 移动开发38 sencha 2.3.2+ 在 安卓2.3上使用报错 - has no method 'bind'

sencha 2.3.2和2.4.0在安卓2.3上面用会报错,具体报错信息如下:

Object function (a){if(!Ext.getBody().contains(a.target)){this.onTouchMove(a)}} has no method 'bind' at file:///android_asset/www/app.js:1


解决办法是:

打开文件:你的App\touch\src\event\publisher\TouchGesture.js

找到第66行:

if (Ext.feature.has.Touch) {
      // bind handlers that are only invoked when the browser has touchevents
      me.onTargetTouchMove = me.onTargetTouchMove.bind(me);
      me.onTargetTouchEnd = me.onTargetTouchEnd.bind(me);
}

改为

if (Ext.feature.has.Touch) {
    // bind handlers that are only invoked when the browser has touchevents
    me.onTargetTouchMove = Ext.Function.bind(me.onTargetTouchMove, me);
    me.onTargetTouchEnd = Ext.Function.bind(me.onTargetTouchEnd, me);
}

然后就好了




欢迎加入Sencha Touch + Phonegap 群:194182999

共同学习交流(博主QQ:479858761)

你可能感兴趣的:(android,移动开发,Cordova,PhoneGap,sencha)