View Full Version : How can I prevent Sencha from rotating and redrawing?

9 Sep 2011, 3:16 AM
I am doing augmented reality apps, so I need to be able to rotate the phone for AR landscape mode, but keep the portarit mode for the all other sections of the app. I have tried forcing iPhone and Android to stay in one orientation but this is not an option. Is there a way to prevent sencha from redrawing after a rotation please?

9 Sep 2011, 6:18 AM
As far as I know, there is no way to prevent Mobile Safari from changing orientation. When safari changes orientation, it automatically try's to rerender the HTML on the page. I'm guessing Sencha tries to make this rerender better through the use of media queries. So, even if you were to prevent Sencha from redrawing the page after an orientation change event, it would not solve your problem. In fact, the html on the page would probably look worse.

As an alternative, you could go through Phonegap which lets you prevent orientation changes.

9 Sep 2011, 7:24 AM
on your outermost panel you might try adding a listener for beforeorientationchange and return false. that may cause it to avoid a render. just a thought

listeners:{ 'beforeorientationchange': function(panel, orientation, width, height){
return false;