Created
January 8, 2012 18:48
-
-
Save bytespider/1579292 to your computer and use it in GitHub Desktop.
Titanium rotation bug?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wnd = Ti.UI.createWindow({ | |
title: "Title Bar", | |
modal: true, | |
backgroundColor: "#FFF", | |
orientationModes: [ | |
Titanium.UI.PORTRAIT, | |
Titanium.UI.UPSIDE_PORTRAIT, | |
Titanium.UI.LANDSCAPE_LEFT, | |
Titanium.UI.LANDSCAPE_RIGHT | |
], | |
layout: "vertical" | |
}); | |
var view = Ti.UI.createView({backgroundColor: "#F00", height: 200}); | |
var view2 = Ti.UI.createView({backgroundColor: "#00F", height: 216}); | |
var text = Ti.UI.createTextArea({backgroundColor: "#0F0", suppressReturn: false}); | |
view.add(text); | |
wnd.add(view); | |
wnd.add(view2); | |
wnd.open(); | |
Ti.Gesture.addEventListener("orientationchange", function (event) { | |
view.height = 200; | |
view2.height = 216; | |
if (event.orientation === Ti.UI.LANDSCAPE_LEFT || event.orientation === Ti.UI.LANDSCAPE_RIGHT) | |
{ | |
view.height = 106; | |
view2.height = 162; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment