Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 42

Thread: Sencha + Phonegap orientation problem

  1. #21
    Sencha User
    Join Date
    Jul 2010
    Paris, France


    Hello !

    I was wondering if anyone of you have tried to use the video example of Sencha with PhoneGap ? How to relay the event, so that the video will change on orientation but not the app ???


  2. #22


    This solution is great!

    When I start the application in Portrait for example and rotate to landscape, everything shuffles into place.

    Unfortunately, for my case, I'm using a map as an item,along with a number of buttons I want to "swipe". I find as soon as I touch the map, the entire Panel shifts up beyond the bounds of the screen. When I rotate back into Portrait, everything is fine again.

    Here is how my example is laid out:
                                                toolbar = new Ext.Toolbar({
                                                              dock: 'top',
                                                              xtype: 'toolbar',
                                                              ui : 'light',
                                                              scroll: 'horizontal',
                                                              defaults: {
                                                              iconMask: true
                                                              items : [
                                                  mapdemo = new Ext.Map({
                                                          mapOptions : {
                                                          center : new google.maps.LatLng(49.25,-123.133333),  //The couver
                                                          zoom : 12,
                                                          mapTypeId : google.maps.MapTypeId.ROADMAP,
                                                          navigationControl: true,
                                                          navigationControlOptions: {
                                                          style: google.maps.NavigationControlStyle.DEFAULT
                                                       new Ext.Panel({
                                                              fullscreen: true,
                                                              layout: {
                                                              type: 'fit'
                                                              dockedItems: [toolbar],
                                                              items: [mapdemo]                                                          

    Integrating a map using a simple DIV with phonegap alone, I can rotate portrait landscape, without any problems.

    If there is a robust solution or a fix that Sencha or PhoneGap is putting out for this, I'd be glad to hear about it

    Thanks a lot!

  3. #23
    Touch Premium Member
    Join Date
    Oct 2010


    Here is my solution on the orientation problem with phonegap. I stop using it and instead using quickconnect which does not have the problem with orientation
    Here is a video on it

  4. #24


    Thanks Ed. I was hoping to work through my Phonegap issues, but I'll definitely give Quick Connect a try!

  5. #25
    Sencha User
    Join Date
    Jan 2011

    Default phonegap + sencha orientation issues...

    I'm having the exact same issue when going from portrait to landscape. Have tried way to many things to no avail.

    However, If I start the app in landscape, everything is fine & I can resize panels, etc on orientation changes. The best I can guess is that 'some screen dimension' for window height stays set at 480 when orientation goes from portrait to landscape - so the panel gets placed in the top 2/3 of that and scrolls as soon as you tap the screen.

    Have tried setting scrollable to false, resetting panel size and origin, trapping tap events, .etc.,

    On the simulator I can get it to work fine by destroying the panel on orientation change, and then recreating it 0.5 seconds after orientation change. But not on the device. I'd be thrilled to hear of a workaround.


  6. #26


    This is what i use.

    // Somewhere on top
    var nativeAppOrientation = Ext.getOrientation();

    if( && navigator.userAgent.match(/safari/i) == null) {
    if(nativeAppOrientation != Ext.getOrientation()) {
    var e = document.createEvent('Events');
    e.initEvent('orientationchange', true, false);
    nativeAppOrientation = Ext.getOrientation();
    }, this, {buffer: 500});
    } - Software Development Blog

  7. #27
    Sencha User
    Join Date
    Jan 2011


    That's very cool code hitman01 - thanks for teaching me how to create new events in js!

    It doesn't solve the problem that anothermarcus posted - that is, if your app starts in portrait mode (with sencha/phonegap) and then reorients to landscape, even if you respond to the orientationChange event and use panel.setOrientation() to make things look right... as soon as you tap the screen anywhere other than the status bar, it will scroll up by about 160 pixels - as if the viewport is still in portrait height.

    this behavior doesn't happen if you start the app in landscape mode - which you can do in phonegap on the simulator, but not on the device, because the user can defeat it while the app is loading by just turning the device... arggghhhh.

    Actually does anyone know a way to lock the device in landscape mode until after the app is done loading? this would be a workaround.

  8. #28
    Sencha User
    Join Date
    Jan 2011


    actually I meant: scroll "down" by about 160 pixels, when you tap the screen, leaving the top of your panel up out of sight until you tap the status bar to bring it back...

  9. #29


    Sorry man, didnt read the whole thing - Software Development Blog

  10. #30


    i was facing this problem and it really irritated me . Now i got the solution .cheers .thanks

Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. Conflict wit sencha / phonegap & html5 database
    By erneso.laval in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 11 Jul 2011, 7:13 PM
  2. Preventing orientation changes?
    By SuperTron in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 19 Jul 2010, 11:20 AM
  3. sencha touch list store problem
    By reminder in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 27 Jun 2010, 11:33 AM
  4. Tab Orientation
    By garyrgi in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 7 Nov 2006, 9:49 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts