Skip to content

Instantly share code, notes, and snippets.

@bytespider
Created January 8, 2012 18:48
Show Gist options
  • Save bytespider/1579292 to your computer and use it in GitHub Desktop.
Save bytespider/1579292 to your computer and use it in GitHub Desktop.
Titanium rotation bug?
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