How to make an LED animation in IPhoneSDK?
I need to create an animation where an LED blinks once. Not the LED flashlight on the Iphone 4 !! Just a simple on screen animation.
Now, here is how I would do this. I would have 2 images, 1x LED off and 1x LED on. Both images would be at the same spot and the LED on would be 100% transparent. Then I would start an animation that would set the transparency to 0% and back to 100%.
Does that sound as a good way to do thi开发者_开发百科s ?
(Update from deleted answer)
Ok here is the part where I do the animate part
[remoteControlLED setHighlighted:YES];
[remoteControlLED setAnimationDuration:15.0];
[remoteControlLED startAnimating];
As you can see, I use the highlight to switch it on, but how do I turn it off again. I mean I need a delay before doing it. Is there a way to have a call when the animation is ready or do I need my own timer ?
There is no callback for UIImageView Animation, but if you just need the animation to repeat a certain amount of times, you can use the setAnimationRepeatCount
精彩评论