Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8848] iOS: Window alignment issue on orientation change

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2012-04-24T11:37:02.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sn/a
ComponentsiOS
LabelsSupportTeam, core
ReporterMauro Parra-Miranda
AssigneeMarshall Culpepper
Created2012-04-20T12:21:14.000+0000
Updated2017-03-09T23:25:02.000+0000

Description

Description problem

When doing a change of orientation when you opening different windows you will get an undesired offset in the tabs when coming back to previous window.

Actual Results

When you come back to the previous window, the window is moved by an offset.

Expected Results

The window not moved.

Test Case

1. Hold the device in portrait and launch the app. 2. Now click the window, it will launch the blue window in landscape. 3. Tilt the device to landscape. 4. Now place it on the table. 5. Click on the blue window. Now the blue window will close, and you can see the parent window displayed in portrait mode, but it would have either moved a little to the top or a little down (check the attached screen).
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
win1.orientationModes=[
Titanium.UI.PORTRAIT,
     Titanium.UI.LANDSCAPE_LEFT,
     Titanium.UI.LANDSCAPE_RIGHT
 ];
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});
gl = {};
var label1 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 1',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});
Ti.include('win2.js');
win1.addEventListener('click',function(){
	gl.createNewWindow();
});
win1.add(label1);
tabGroup.addTab(tab1);  
tabGroup.open();
gl.createNewWindow = function(){
	var win2 = Titanium.UI.createWindow({  
    title:'I am window2',
    backgroundColor:'blue'
});
win2.orientationModes=[
     Titanium.UI.LANDSCAPE_LEFT,
     Titanium.UI.LANDSCAPE_RIGHT
 ];
 
 win2.open();
  win2.addEventListener('click',function(e){
 	//Ti.Android.currentActivity.setRequestedOrientation(Ti.Android.SCREEN_ORIENTATION_PORTRAIT);
 	win2.close();
 	Ti.UI.orientation = Titanium.Gesture.orientation;
 })
}

HD Discussion

http://support-admin.appcelerator.com/display/APP-851611/conversation/read_all

Attachments

FileDateSize
photo.PNG2012-04-20T12:21:14.000+000033631

Comments

  1. Vishal Duggal 2012-04-23

    Ti.UI.orientation is a deprecated property and is not guaranteed to work. orientationModes is the preferred way to control window orientations.
  2. Vishal Duggal 2012-04-23

    Using deprecated property + there is no clear indication as to what the code is trying to accomplish
  3. Mauro Parra-Miranda 2012-04-23

    Added this info, the link to the docs and the example of code into the HD. Best, Mauro
  4. Mauro Parra-Miranda 2012-04-24

    Hello, the customer was using a deprecated call to the API. ONce it's using the recent one, there is no bug anymore. Best, Mauro
  5. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source