How can I update the window when the orientation changes?
I added a Ti.Gesture.addEventListener('orientationchange')
to my class. I'm trying to shift everything left a certain amount when the view updates. How can I do this? label.left = 100;
?
2 Answers
-
I'd also be interested is a little code sample to make that work
-
Never mind, did it.
Code:
Ti.Gesture.addEventListener('orientationchange',function(e) { // now do stuff... refresh etc.. if(e.orientation == 1 || e.orientation == 2) { // Function that changes the left property of // just about every item in the view Window.rotateStandard(); } else if(e.orientation == 3 || e.orientation == 4) { Window.rotateLandscape(); } else { // Guess Window.rotateStandard(); } });