Sencha touch 2.4.2 已经解决问题了。javascript
比方你为Ext.Viewport的orientationchange事件加入了一个监听方法:java
Ext.Viewport.on('orientationchange', function(){ alert('转屏了') }, this);android
经測试,安卓自带浏览器,或者phonegap打包的app。在转屏的时候都没有弹出"转屏了"的对话框。(sencha官方论坛有很是多人反映这个问题,貌似sencha touch 2.0+都存在)web
而chrome for android打开这个webapp,尽管能触发。但是第一次转屏没有触发,第二次转屏触发运行的是第一次的监听方法。chrome
解决的方法:浏览器
在app.js的launch方法中,加入如下的代码:app
<span style="font-family:Microsoft YaHei;">if (Ext.os.is.Android) { Ext.Viewport.addWindowListener('resize', Ext.Function.bind(Ext.Viewport.onResize, Ext.Viewport)); Ext.Viewport.updateSize(); //added Ext.Viewport.orientation = Ext.Viewport.determineOrientation(); //added }</span>
欢迎增长Sencha Touch + Phonegap 群:194182999webapp
共同窗习交流(博主QQ:479858761)post