Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1123] Orientation Change not working correctly

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:55:16.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.4.0
ComponentsiOS
Labelsdefect, ios, iphone, mode, orientation
Reporterctredway
AssigneeReggie Seagraves
Created2011-04-15T02:44:37.000+0000
Updated2011-04-17T01:55:16.000+0000

Description

In sdk 1.3.1 the first orientation change is not honored when setting the orientation mode to PORTRAIT only. The code below shows that the window rotates to landscape on the first rotation only, then it follows what was set in orientation modes. Just a note: this is holding up the app of the customer that found this.

// this sets the background color of the master UIView (when there are no windows/tab groups on it) Titanium.UI.setBackgroundColor('#000');

// // create base UI tab and root window // var win1 = Titanium.UI.createWindow({

title:'Tab 1',
backgroundColor:'#fff'

});

win1.add( Ti.UI.createLabel( { text: 'label to show orientation', top:50, left:10}));

win1.orientationModes =[Ti.UI.PORTRAIT];
win1.orientation = Ti.UI.PORTRAIT;

// open tab group win1.open();

Comments

  1. ctredway 2011-04-15

    fyi - this holding up a premium customers project.
    http://helpdesk.appcelerator.net/tickets/3007">http://helpdesk.appcelerator.net/tickets/3007

  2. Stephen Tramer 2011-04-15

    In the following (correct) code I'm not seeing any orientation issues:

       // this sets the background color of the master UIView (when there are no windows/tab groups on it) 
       Titanium.UI.setBackgroundColor('#000');
       
       // // create base UI tab and root window // 
       var win1 = Titanium.UI.createWindow({
       
       title:'Tab 1',
       backgroundColor:'#fff'
       });
       
       win1.add( Ti.UI.createLabel( { text: 'label to show orientation', top:50, left:10}));
       
       win1.orientationModes =[Ti.UI.PORTRAIT];
       Ti.UI.orientation = Ti.UI.PORTRAIT;
       
       // open tab group 
       win1.open();
       

    The window stays in PORTRAIT orientation, even as the device rotates.

    Will get some independent confirmation from Blain and determine if the helpdesk ticket is asking something different before closing.

  3. ctredway 2011-04-15

    in 1.3.1 this is broken. it may be fixed in head but I have not built from
    head.

  4. Stephen Tramer 2011-04-15

    Could you check in head and see if this was fixed? Blain may actually have done it already as part of another ticket, and I can't reproduce the behavior you seem to be describing.

  5. Stephen Tramer 2011-04-15

    This issue still exists. The JS above actually demonstrates correct behavior, but the following reproduces the described bug:

       // this sets the background color of the master UIView (when there are no windows/tab groups on it) 
       Titanium.UI.setBackgroundColor('#000');
       
       // // create base UI tab and root window // 
       var win1 = Titanium.UI.createWindow({
       
       title:'Tab 1',
       backgroundColor:'#fff'
       });
       
       win1.add( Ti.UI.createLabel( { text: 'label to show orientation', top:50, left:10}));
       
       win1.orientationModes =[Ti.UI.PORTRAIT,Ti.UI.LANDSCAPE_LEFT];
       Ti.UI.orientation = Ti.UI.LANDSCAPE_LEFT;
       
       // open tab group 
       win1.open();
       
  6. Stephen Tramer 2011-04-15

    Okay, my mistake. This is fixed in HEAD, it must be a duplicate of something Blain did. All I can say is that you should be aware of the difference between PORTRAIT and UPSIDE_PORTRAIT.

  7. ctredway 2011-04-15

    I understand. However, our docs are not up to snuff. We have to remember our target audience are not obj-c programmers, so they may not know the difference between PORTRAIT and UPSIDE_PORTRAIT.

  8. Stephen Tramer 2011-04-15

    I've made a doc change that clarifies this.

JSON Source