PDA

View Full Version : Sencha + PhoneGap Orientation again



plug12
8 Feb 2012, 12:55 AM
Hi.
I tried everything, but nothing worked for me.

I want to get the orientation change for the Idiomatic Layout Tutorial(http://www.sencha.com/learn/idiomatic-layouts-with-sencha-touch), but the setProfile methods are not called.

I changed the PhoneGapViewController.m like in this thread (http://www.sencha.com/forum/showthread.php?109839-onOrientationChange-event-is-not-being-handled-properly-on-ip*-devices-by-uiwebview/page2)


And i tried this one from Oxynel (http://blog.oxynel.com/creation-site-internet-montpellier/phonegap-sencha-orientation-change-solution_2010_08)


Ext.setup({
onReady: function() {
panel = new Ext.Panel({
fullscreen: true,
layout: 'card',
items:[{xtype:'panel',contentEl:'portrait-container',scroll:'vertical'},
{xtype:'panel',contentEl:'landscape-container',scroll:'false'}]
});
Ext.EventManager.onWindowResize(setActivePanel);}});

function setActivePanel(){
panel.setOrientation( Ext.getOrientation() , window.innerWidth , window.innerHeight );
};


Somtimes the function works, but i cant call my setProfile methods with this.


Is there any working solution or could anybody help me with this (PhoneGap 1.4.1 with Sencha Touch 1.1.1)?

plug12
8 Feb 2012, 2:10 AM
Ext.EventManager.onWindowResize(setActivePanel);only fires once, when I have code in setActivePanel(){}...thats the problem

welshcathy
13 Feb 2012, 2:29 AM
Have you seen this thread?

http://www.sencha.com/forum/showthread.php?105092-Sencha-Phonegap-orientation-problem