Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

orientationModes ignored on load (iPhone 3G)

If my iPhone 3G (3.1.2 firmware) is in landscape mode before my app is loaded, the app starts in landscape mode even though I have the following code:

rootWin.orientationModes = [
Titanium.UI.PORTRAIT
];

When the app is running, I can then rotate the phone to portrait, and the app rotates with it, and then if I try to rotate back to landscape it remains locked to portrait.

So I just don't get why it allows landscape on load, but not any other time?

— asked August 19th 2010 by Todd Gronwood
  • execute
  • iphone
  • load
  • orientation
  • orientationmodes
  • rotate
  • start
0 Comments

4 Answers

  • It's on the plist file, remove other orientations and just allow portrait to load.

    <key>UISupportedInterfaceOrientations</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
        </array>
        <key>UISupportedInterfaceOrientations~ipad</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
        </array>
    
    — answered August 19th 2010 by Daniel Lim
    permalink
    0 Comments
  • Daniel,
    I've edited the Info.plist file in Xcode (after Titanium's compiled the app), then compiled in Xcode and tried it on the device again, but this setting doesn't seem to make any difference.

    This issue also exists on iPod Touch (2nd gen, 3.1.3 firmware).

    — answered August 20th 2010 by Todd Gronwood
    permalink
    0 Comments
  • Todd, i just tested it on 3G/3.1.3 and see the same issue, it flips to landscape mode momentarily (after splash) but seems to work correctly on iPad.

    Try open a ticket here

    https://appcelerator.lighthouseapp.com/projects/32238-titanium-mobile

    — answered August 20th 2010 by Daniel Lim
    permalink
    0 Comments
  • ticket opened: https://appcelerator.lighthouseapp.com/projects/32238/tickets/1612-iphone-ios-orientationmodes-ignored-on-load

    — answered August 20th 2010 by Todd Gronwood
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.