您的位置:首页 > 其它

[Phonegap+Sencha Touch] 移动开发28 小米3不支持Sencha touch的解决办法

2014-07-15 09:47 381 查看
sencha touch 2.4.0已经修复这个问题了

Sencha Touch 2.3.1官网demo,用小米3自带浏览器打开,点击无反应
http://cdn.sencha.io/touch/sencha-touch-2.3.1/built-examples/kitchensink/index.html
打包phonegap之后,同样点击没有效果,无法使用。

解决办法:

打开文件\touch\src\event\publisher\Dom.js

123行

doc.defaultView.addEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
修改为:
if (/MI 3 Build/.test(navigator.userAgent)) {
document.addEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
}
else {
doc.defaultView.addEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
}

然后

142行

doc.defaultView.removeEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));

修改为:

if (/MI 3 Build/.test(navigator.userAgent)) {
document.removeEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
}
else {
doc.defaultView.removeEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
}

听说米3现在的固件(4.6.13及以上版本)已经修复了这个问题,不过我让别人用4.6.20的固件试了下,还是不行。

欢迎加入Sencha Touch + Phonegap 群:194182999

共同学习交流(博主QQ:479858761
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐