You are here

Sencha Touch 2 Orientation problem in Android browser or Webview

Blog Terms: 

Issue:
Sencha Touch 2 was used in project and tested in Android browser or webview, when orietation is being changed, from landscape to portait or reverse, the layout will take the previous orietation's height, or half of the screen.

Solution:

Ext.setup({
viewport:{
autoMaximize:true},
onReady:function(){
Ext.Viewport.on('orientationchange', function() {
if (Ext.os.is.Android) {
Ext.Viewport.setSize(window.innerWidth,window.innerHeight);
}
});

......
}
...

Refer:
http://www.sencha.com/forum/showthread.php?244913-Orientation-event-timi...

http://www.sencha.com/forum/showthread.php?244266-difference-in-developm...