Skip to content

Instantly share code, notes, and snippets.

@srkirkland
Created February 19, 2015 08:09
Show Gist options
  • Save srkirkland/c1248fe46220328e08ef to your computer and use it in GitHub Desktop.
Save srkirkland/c1248fe46220328e08ef to your computer and use it in GitHub Desktop.
rotation overlay
var centerImg = new UIImageView (UIImage.FromBundle ("findme_fab"));
centerImg.Frame = new RectangleF (
centerX - (centerImg.Frame.Width / 2) ,
centerY - centerImg.Frame.Height - 20 ,
centerImg.Frame.Width ,
centerImg.Frame.Height);
var animation = CABasicAnimation.FromKeyPath("transform.rotation.z");
animation.From = NSNumber.FromFloat (0.0f);
animation.To = NSNumber.FromFloat (2f * (float)Math.PI);
animation.Duration = 1f;
animation.RepeatCount = float.MaxValue;
centerImg.Layer.AddAnimation (animation, "spinAnimation");
AddSubview (centerImg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment