Created
February 19, 2015 08:09
-
-
Save srkirkland/c1248fe46220328e08ef to your computer and use it in GitHub Desktop.
rotation overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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