Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8859] iOS: Scrollview elements doesn't allow animation in 2.0

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-10T05:08:36.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-09 Core
ComponentsiOS
LabelsSupportTeam, core, module_scrollview, qe-testadded
ReporterMauro Parra-Miranda
AssigneeMax Stepanov
Created2012-04-23T09:14:29.000+0000
Updated2012-07-10T13:46:11.000+0000

Description

Problem Description

You can't animate an element inside the scrollview when you are using SDK 2.0. You were able to do it in 1.8.2.

Actual results

No animation in the element inside the scrollview.

Expected results

Being able to animate the view

Test Case

1. Create a new mobile app. 2. Paste this code:
var win = Ti.UI.createWindow();
	
	var scrollView = Ti.UI.createScrollView({
		contentHeight: 'auto',
		contentWidth: 'auto',
		layout:'vertical', //Change from default value from absolute to a relative distance between the sibling views
		scrollType:"vertical",
		top: 0,
		showVerticalScrollIndicator: true,
		showHorizontalScrollIndicator: false
	});	
	
	var mapView = Ti.Map.createView({
	    mapType: Ti.Map.STANDARD_TYPE,
		height: 150,
		top:0,
	    animate:true,
	    regionFit:true,
		userLocation:true,
	    annotations:[]
	});
	
	var resizeBtn = Ti.UI.createButton({
		title:"resize map",
		width:100,
		height:44,
		right:5,
		bottom:5
	});
	var mapToggle = false;
	resizeBtn.addEventListener("click", function(e){
		mapToggle = !mapToggle;
		if(mapToggle){
			mapView.animate({height:250, duration:300});
		} else {
			mapView.animate({height:150, duration:300});
		}
	});
	mapView.add(resizeBtn);
	scrollView.add(mapView);
	
	//other content
	var testView = Ti.UI.createView({top:0, height:200, width:300, backgroundColor:"red"});
	
	var resize2Btn = Ti.UI.createButton({
		title:"resize view",
		width:120,
		height:44,
		right:5,
		bottom:5
	});
	var toggle = false;
	resize2Btn.addEventListener("click", function(e){
		toggle = !toggle;
		if(toggle){
			testView.animate({height:300, duration:300});
		} else {
			testView.animate({height:200, duration:300});
		}
	});
	testView.add(resize2Btn);
	scrollView.add(testView);
	
	//other content
	scrollView.add(Ti.UI.createView({top:0, height:200, width:300, backgroundColor:"blue"}));
	
	win.add(scrollView);
	
win.open();

Comments

  1. Max Stepanov 2012-04-26

    PR pending https://github.com/appcelerator/titanium_mobile/pull/2079
  2. Michael Pettiford 2012-06-19

    Closing issue Tested with Ti Studio build 2.1.0.201206172244 Ti Mobile SDK 2.1.0.v20120619142258 hash r5982b78e OSX Lion 10.7.3 iPhone 4S OS 5.1 The expected behavior is shown
  3. Shyam Bhadauria 2012-07-10

    Re-opening to edit label

JSON Source