Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11015] iOS: Orientation - While changing orientation from landscape to portrait, view does not resize smoothly.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-26T08:35:35.000+0000
Affected Version/sRelease 2.1.3
Fix Version/sRelease 3.0.2
ComponentsiOS
Labelsqe-ios090112
ReporterAnshu Mittal
AssigneeShameer Jan
Created2012-09-20T03:19:50.000+0000
Updated2017-03-17T18:45:56.000+0000

Description

While changing orientation from landscape to portrait, view does not resize smoothly whereas it resizes smoothly while changing the orientation from portrait to landscape. Steps to reproduce: 1. create a test app using the code below. 2. launch the test app. 3. Click 'press me' button. 4. Now change the orientation to landscape. Red and blue view should resize smoothly. 5. Now change the orintation to portrait. Red and blue view resize again. Actual: 5. Red and blue view do not resize smoothly. Change in size is noticable. Expected: Resizing of view should be smooth.
var win1 = Titanium.UI.createWindow({  
	 backgroundColor:'#fff'
});
	
		var btn = Ti.UI.createButton({
			width: 70,
			height: 70,
			title: 'press me',
			color: 'black'
		});
		
		win1.add(btn);
		
		btn.addEventListener('click', function() {
			
			var abtn = Ti.UI.createButton({
			width: 40,
			height: 40,
			title: 'close',
			color: 'black'
		});
			
			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);
			view.add(abtn)
			wnd.open();

           abtn.addEventListener('click', function() {
           	    wnd.close();
           });

			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;
				}
			}); 
			
		});
	win1.open();

Comments

  1. Shameer Jan 2013-03-26

    Issue does not reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 5.1,6.0
  2. Lee Morris 2017-03-17

    Closing ticket as the issue cannot be reproduced.

JSON Source