Create a spinning animation
I have an image that I want to rotate 360° (clockwise) and then repeat and
I'm having trouble hitting on the right way to do this. I can do this:
UIView.Animate(1, 0, UIViewAnimationOptions.Repeat,
() =>
{
LoadingImage.Transform =
MonoTouch.CoreGraphics.CGAffineTransform.MakeRotation(-(float)(Math.PI));
},
() =>
{
});
Which rotates my image 180° and then snaps back to the start and repeats.
So, I thought if I do something like 1.99 * PI, it would rotate almost all
the way around and probably look ok. Unfortunately, the animation system
is smart than that and will just rotate in the opposite direction instead!
So what's the right way to get an image to spin 360° continuously?
No comments:
Post a Comment