Disable screen rotation for certain windows?

You must Login before you can answer or comment on any questions.

I know for sure I don't want the splash to rotate. I have the login window outside of the tabgroup.. I don't want it to rotate, but all the windows loaded by the tabgroup can rotate. Is this possible?

2 Answers

Accepted Answer

@Tyler pretty much possible chose orientation wisely

windows.orientationModes = [Titanium.UI.PORTRAIT];
and in case you want to enable more ...

DO

win.orientationModes = [
    Titanium.UI.PORTRAIT,
    Titanium.UI.UPSIDE_PORTRAIT,
    Titanium.UI.LANDSCAPE_LEFT,
    Titanium.UI.LANDSCAPE_RIGHT,
    Titanium.UI.FACE_UP,
    Titanium.UI.FACE_DOWN
];
Chose wisely which all orientation you want to focus on !!

I was able to get this working. Just backwards from that I was trying to do. I originally had ex. 1.1 and was trying to lock just the splash & login. I replaced it with 1.2 and then when I created the internal windows I added 1.3. Now the internal windows rotate like I want, and the splash/login are locked in portrait.

1.1

<orientations device="iphone">
            <orientation>Ti.UI.PORTRAIT</orientation>
            <orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
            <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
        </orientations>
        <orientations device="ipad">
            <orientation>Ti.UI.PORTRAIT</orientation>
            <orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
            <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
        </orientations>
1.2
<orientations device="iphone">
            <orientation>Ti.UI.PORTRAIT</orientation> 
        </orientations>
        <orientations device="ipad">
            <orientation>Ti.UI.PORTRAIT</orientation>
        </orientations>
1.3
orientationModes: [Ti.UI.LANDSCAPE_LEFT,Ti.UI.LANDSCAPE_RIGHT,Ti.UI.PORTRAIT]

— answered 10 months ago by Tyler Presley
answer permalink
2 Comments
  • hey, i do not understand... does this stuff go into a file somewhere? if so, which file, and where?

    — commented 8 months ago by lord bharal

  • 1.2 goes in tiapp.xml

    1.3 is a window property.

    if you do it this way you have to set the orientationModes when you create windows.

    http://docs.appcelerator.com/titanium/2.1/#!/api/Titanium.UI.Window

    — commented 8 months ago by Tyler Presley

Your Answer

Think you can help? Login to answer this question!