Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7028] iOS: Vertical layout not working on orientation change

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-04-02T14:30:57.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsiOS
Labelsmodule_orientation, qe-testadded, regression
ReporterKevin Whinnery
AssigneeVishal Duggal
Created2012-01-09T05:36:55.000+0000
Updated2012-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.

Comments

  1. Kevin Whinnery 2012-01-09

    Original report and potential alternate solution: http://developer.appcelerator.com/question/130389/controls-fall-under-the-navigation-bar-after-rotation
  2. Mitchell Amihod 2012-02-18

    Layouts in modal windows in general are not being redrawn correctly on an orientation change.
  3. Satyam Sekhri 2012-03-16

    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)
  4. Michael Pettiford 2012-04-02

    Reopening/closing to add/remove labels

JSON Source