Hi, I have used the custom androidManifest xml approach to force portrait orientation. It was working fine in 1.7.1 but isn't working in 1.7.2 is this an issue or did something change?
3 Answers
Accepted Answer
Hi,
here is the solution (that worked for me):
You have to set the property "orientationModes" of your window object to [Ti.UI.PORTRAIT]...
AND... you have to do this outside of the createWindow Method. Only then the orientation is set. Here is my code:
var mainWindow = Ti.UI.createWindow({ exitOnClose: true, name: 'mainWindow', windowSoftInputMode: Ti.UI.Android.SOFT_INPUT_ADJUST_PAN, navBarHidden: true, backgroundColor: 'white' }); mainWindow.orientationModes = [Ti.UI.PORTRAIT];
i don't know how you are structuring your apps, but i'm including a file on top of the code for every window used. inside this file that get's included everytime i put
// set portrait mode to all windows automatically try { Ti.UI.orientation = Ti.UI.PORTRAIT; } catch (e) { }to automatically set orientation to potrait mode, the try-catch comes to use, if included on top of the app.js
Unfortunately, this is still broken in 1.7.2. In fact, it's even more broken in 1.7.2 as the camera is now opposite to the orientation the app starts in.
Your Answer
Think you can help? Login to answer this question!