ImageView repeatCount bug?
I have an animation that works except when the repeatCount is set to any value above 1 - which makes the animation loop indefinitely.
var imageView = Titanium.UI.createImageView({
images:images,
duration:100, // in milliseconds, the time before next frame is shown
repeatCount:2, // 0 means animation repeats indefinitely, use > 1 to control repeat count
top:0,
width: 320,
height: 480
});
I should note that setting the value to 1 does the job but I need it to loop more than once. Is this a known bug?
7 Answers
-
Which platform(s)?
-
iPhone SDK 3.1 using titanium developer 1.0 and the mobile SDK 1.0
-
iPhone SDK 3.1 using titanium developer 1.0 and the mobile SDK 1.0
-
I have this same problem. Did you resolve the issue? This is with the Titanium 1.2 and iphone 4.2.
-
I've documented this bug here: https://appcelerator.lighthouseapp.com/projects/32238-titanium-mobile/tickets/3122-imageview-animation-ignores-repeatcount-upon-second-call-to-start
-
Titanium is open source. it was mixed python and Object-C
This code is about TiAnimation.mif (repeat!=nil)
{
[UIView setAnimationRepeatCount:[repeat intValue]];
}So. I think that repeat argument doesn't have a infinity value.
insane! -
The BUG still persists as of my test today on Ti 3.5.0 GA.
One simple workaround is to stop the animation upon the end of image sequence, like this:
$.animation.addEventListener('change', function(e){ if (e.index === current_clip_length-1) { $.animation.stop(); } });
I need to use such animation function due to unreliable cross-platform video playback control. Would love to know if native Ti videoplayer could be controlled frame by frame precisely.