public override void Clone(CALayer other) { CircleLayer o = (CircleLayer)other; Radius = o.Radius; Color = o.Color; Thickness = o.Thickness; base.Clone(other); }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); vc = new UIViewController (); vc.View.BackgroundColor = UIColor.Black; testLayer = new CircleLayer(); testLayer.Color = UIColor.Green.CGColor; testLayer.Thickness = 19f; testLayer.Radius = 60f; testLayer.Frame = vc.View.Layer.Bounds; vc.View.Layer.AddSublayer(testLayer); testLayer.SetNeedsDisplay(); radiusAnimation = CABasicAnimation.FromKeyPath ("radius"); radiusAnimation.Duration = 3; radiusAnimation.To = NSNumber.FromDouble (120); radiusAnimation.RepeatCount = 1000; thicknessAnimation = CABasicAnimation.FromKeyPath ("thickness"); thicknessAnimation.Duration = 2; thicknessAnimation.From = NSNumber.FromDouble (5); thicknessAnimation.To = NSNumber.FromDouble (38); thicknessAnimation.RepeatCount = 1000; colorAnimation = CABasicAnimation.FromKeyPath ("circleColor"); colorAnimation.Duration = 4; colorAnimation.To = new NSObject (UIColor.Blue.CGColor.Handle); colorAnimation.RepeatCount = 1000; testLayer.AddAnimation (radiusAnimation, "radiusAnimation"); testLayer.AddAnimation (thicknessAnimation, "thicknessAnimation"); testLayer.AddAnimation (colorAnimation, "colorAnimation"); window.RootViewController = vc; // make the window visible window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow(UIScreen.MainScreen.Bounds); vc = new UIViewControllerRotation(); vc.View.BackgroundColor = UIColor.Black; testLayer = new CircleLayer(); testLayer.Color = UIColor.Green.CGColor; testLayer.Thickness = 19f; testLayer.Radius = 60f; testLayer.Frame = vc.View.Layer.Bounds; vc.View.Layer.AddSublayer(testLayer); testLayer.SetNeedsDisplay(); radiusAnimation = CABasicAnimation.FromKeyPath("radius"); radiusAnimation.Duration = 3; radiusAnimation.To = NSNumber.FromDouble(120); radiusAnimation.RepeatCount = 1000; thicknessAnimation = CABasicAnimation.FromKeyPath("thickness"); thicknessAnimation.Duration = 2; thicknessAnimation.From = NSNumber.FromDouble(5); thicknessAnimation.To = NSNumber.FromDouble(38); thicknessAnimation.RepeatCount = 1000; colorAnimation = CABasicAnimation.FromKeyPath("circleColor"); colorAnimation.Duration = 4; colorAnimation.To = new NSObject(UIColor.Blue.CGColor.Handle); colorAnimation.RepeatCount = 1000; testLayer.AddAnimation(radiusAnimation, "radiusAnimation"); testLayer.AddAnimation(thicknessAnimation, "thicknessAnimation"); testLayer.AddAnimation(colorAnimation, "colorAnimation"); window.RootViewController = vc; // make the window visible window.MakeKeyAndVisible(); return(true); }