Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6228] iOS: animate callback never gets executed when when using Ti.UI.createAnimation

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2013-03-01T23:21:00.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sn/a
ComponentsiOS
Labelscore
ReporterJon Alter
AssigneeIngo Muschenetz
Created2011-11-17T18:23:43.000+0000
Updated2017-03-22T22:11:08.000+0000

Description

Animate callback never gets called if you use Ti.UI.createAnimation. It get called if you use an object instead. Step 1: Run the code below Step 2: click the window Step 3: notice that the info statement never shows Step 4: in animate() replace 'animation' with 'animationObj'. Step 5: run code Step 6: click the window Step 7: notice the info statement in the callback shows up.
var win = Ti.UI.createWindow({
	backgroundColor:'blue'
});

win.addEventListener('click',function(e){
	Ti.API.info('CLICKED');
	var animation = Ti.UI.createAnimation({
		backgroundColor:'red',
		duration: 500
	});
	var animationObj = {backgroundColor:'red', duration:2000};
	win.animate(animation, function(){
		Ti.API.info('DONE!!!');
	});
});

win.open();

Workaround(s)

1. use an object for your animation 2. animation.addEventListener('complete', function(){});

Comments

  1. Anirudh Nagesh 2012-07-10

    HD ticket: appc.me/c/APP-321655
  2. Lee Morris 2017-03-22

    Closing ticket as duplicate and links to the related ticket have been provided above.

JSON Source