[TIMOB-7028] iOS: Vertical layout not working on orientation change
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-04-02T14:30:57.000+0000 |
Affected Version/s | Release 1.8.0.1 |
Fix Version/s | Release 2.0.0, Sprint 2012-06 |
Components | iOS |
Labels | module_orientation, qe-testadded, regression |
Reporter | Kevin Whinnery |
Assignee | Vishal Duggal |
Created | 2012-01-09T05:36:55.000+0000 |
Updated | 2012-04-02T14:30:57.000+0000 |
Description
On iOS in Titanium Mobile 1.8.0.1, vertical layouts are not being redrawn correctly on an orientation change. This seems also be related to the specific use of a modal window in this example. The following was reported by a community member, and confirmed not to be working by me.
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;
}
});
When the above is run, the window displays correctly initially, but when the orientation change happens, it appears to start drawing the content underneath the nav bar for this window.
Original report and potential alternate solution: http://developer.appcelerator.com/question/130389/controls-fall-under-the-navigation-bar-after-rotation
Layouts in modal windows in general are not being redrawn correctly on an orientation change.
Closing bug. The vertical layout works fine on orientation change. No part of the content gets hidden. Verified fix on: SDK build: 2.0.0.v20120316093247 Titanium Studio, build: 2.0.0.201203152033 Device: iPhone4 (V4.3.5)
Reopening/closing to add/remove labels