Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8379] Android: Orientation Landscape not working for tabs

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2020-01-10T18:03:05.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsreprod
Reporterbn
AssigneeYordan Banev
Created2012-02-28T09:44:21.000+0000
Updated2020-01-10T18:03:05.000+0000

Description

Problem Description

I want to use some tabs with some content only in landscape mode. That doesn't work.

Actual Results

the window doesn't lock

Expected results

the tabs being locked at LAndscape

Test Case

var win = Titanium.UI.createWindow({
	backgroundColor : '#fff',
	title : 'X'
});
var win1 = Titanium.UI.createWindow({
	backgroundColor : '#fff',
	title : 'Y'

});

win.orientationModes = [
//Titanium.UI.PORTRAIT,
Titanium.UI.LANDSCAPE_LEFT];

win1.orientationModes = [
//Titanium.UI.PORTRAIT,
Titanium.UI.LANDSCAPE_LEFT];

// create tab group
var tabGroup = Titanium.UI.createTabGroup();

var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'FirstTab',
window:win

});
var tab2 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'SecondTab',
window:win1
});

// Create a Label.
var aLabel1 = Ti.UI.createLabel({
	text : 'TEST1',
	color : 'red',
	font : {fontSize:20},
	height : 24,
	width : 80,
	top : 20,
	left : 20,
	textAlign : 'center'
});
// Create a Label.
var aLabel2 = Ti.UI.createLabel({
	text : 'TEST2',
	color : 'red',
	font : {fontSize:20},
	height : 24,
	width : 80,
	top : 20,
	left : 20,
	textAlign : 'center'
});

// Add to the parent view.
win.add(aLabel1);
win1.add(aLabel2);

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

Comments

  1. Shameer Jan 2013-03-13

    The problem reproduces with release 3.0.2 and master release 3.1.0 tested on Titanium Studio, build: 3.0.2.201302191606 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Device: Samsung galaxy s duos Android version: 4.0.4 Android Emulator: Android SDK version: 2.2 iOS iPhone Simulator: iOS SDK version: 6.0 It works fine on IOS iphone simulator
  2. Lee Morris 2017-07-12

    I am able to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131
  3. Yordan Banev 2018-10-04

    In the documentation it is noted that this property will not be supported for windows inside TabGroup: https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Window-property-orientationModes TabGroup itself respects the property and opens in the proper orientation. Is the desired effect to show the content only of a specific tab with a locked orientation and to use the auto-chosen for the rest?

JSON Source