Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3460] iOS: TabGroup Reaction to Orientation Changes

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2011-12-02T10:29:56.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.8.0.1
ComponentsiOS
Labelsn/a
ReporterMenoites
AssigneeDon Thorp
Created2011-04-15T03:45:29.000+0000
Updated2012-03-30T09:49:15.000+0000

Description

So I have 3 tabs added to my TabGroup, with 1 window per tab.

var win1 = Ti.UI.createWindow();
var win2 = Ti.UI.createWindow();
var win3 = Ti.UI.createWindow();

var tab1 = Ti.UI.createTab({window:win1});
var tab2 = Ti.UI.createTab({window:win2});
var tab3 = Ti.UI.createTab({window:win3});

So I want win1 to allow the following orientations:

Ti.UI.PORTRAIT
Ti.UI.UPSIDE_PORTRAIT
Ti.UI.LANDSCAPE_RIGHT
Ti.UI.LANDSCAPE_LEFT

But only allow win2 and win3 the first two (PORTRAIT and UPSIDE_PORTRAIT), so I set the orientationModes of the windows:

var tabGroup = Ti.UI.createTabGroup({barColor:'#000'});

var win1 = Ti.UI.createWindow();
var win2 = Ti.UI.createWindow();
var win3 = Ti.UI.createWindow();

win1.orientationModes = [
    Ti.UI.PORTRAIT,
    Ti.UI.UPSIDE_PORTRAIT,
    Ti.UI.LANDSCAPE_LEFT,
    Ti.UI.LANDSCAPE_RIGHT
];
win2.orientationModes = [
    Ti.UI.PORTRAIT,
    Ti.UI.UPSIDE_PORTRAIT
];
win3.orientationModes = [
    Ti.UI.PORTRAIT,
    Ti.UI.UPSIDE_PORTRAIT
];

var tab1 = Ti.UI.createTab({window:win1});
var tab2 = Ti.UI.createTab({window:win2});
var tab3 = Ti.UI.createTab({window:win3});

tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.addTab(tab3);
tabGroup.open();

So when you are in win1 and change the orientation of the device/simulator to landscape and then click onto either of tab2 or tab3 (Switching to win2 or win3), the orientation will change but the tabs will react oddly.

The third one will simply disappear with the first two (tab1 & tab2) resizing to be half the tabGroup. After that, there seems to be no way to get the tab back without closing the app.

Note that this is using Titanium Mobile 1.6.1, Titanium Developer 1.3.0, and using iOS 4.3[.1].

Comments

  1. tom quas 2011-10-07

    Hmm, there hasn't been much progress on this one in a while. I just ran into the same issue using Ti 1.7.2. Is there a work-around? This clearly limits the usability of at least my app, especially for people who don't want type on the small keyboard in portrait mode.
  2. Paul Dowsett 2011-12-02

    Reassigning this ticket with several watchers, due to Reggie's absence.
  3. Stephen Tramer 2011-12-02

    Unable to reproduce in 1.8.0.1.4af3059 on iPhone Sim iOS 5.
  4. Michael Pettiford 2012-03-30

    Closing issue Tested with Ti Studio build 2.0.0.201203291340 Ti Mobile SDK 2.0.0.v20120329191102 hash r1fbf18c4 OSX Lion 10.7.3 iPhone 4S OS 5.0.1 Cannot reproduce the issue

JSON Source