Titanium Community Questions & Answer Archive

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

Webview Portrait / Landscape orientation on Android

I create a custom AndroidManifest to avoid the landscape orientation and works fine.
How could I make that only the webviews can change it´s orientation?

— asked November 29th 2010 by Francisco López
  • android
  • manifest
  • orientation

2 Answers

  • Francisco

    You would have to set the orientationModes property of Titanium.UI.Window to a specific orientation for standard windows, and then don't specify any orientation mode for webviews.

    For example

    var win = Titanium.UI.currentWindow;
    win.orientationModes = [Titanium.UI.LANDSCAPE_LEFT];

    I think you would have to remove your modification of the AndroidManifest though.

    — answered November 29th 2010 by Paul Dowsett
    1 Comment
    • Note that the other orientation modes are LANDSCAPE_RIGHT, PORTRAIT and UPSIDE_PORTRAIT, as stated in the Titanium.UI docs

      — commented November 29th 2010 by Paul Dowsett
  • Thank you for you answer Hal but orientationModes don´t prevent a orientation change, at least on the emulator.

    — answered November 30th 2010 by Francisco López
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.