//Private methods private void Expand() { if (Flag == MenusArray.Count) { IsAnimating = flase; Timer.Invalidate(); Timer = null; return; } var Tag = 1000 + Flag; ApexMenuItem item = this.ViewWithTag(Tag); var rotateAnimation = (CAKeyFrameAnimation)CAKeyFrameAnimation.FromKeyPath("transform.rotation.z"); rotateAnimation.Values = new NSNumber[] { this.ExpandRotation, 0.0f }; rotateAnimation.Duration = AnimationDuration; rotateAnimation.KeyTimes = new NSNumber[] { 0.3f, 0.4f }; var positionAnimation = (CAKeyFrameAnimation)CAKeyFrameAnimation.FromKeyPath("position"); positionAnimation.Duration = AnimationDuration; var path = new CGPath(); path.MoveToPoint(item.StartPoint.X, item.StartPoint.Y); path.AddLineToPoint(item.FarPoint.X, item.FarPoint.Y); path.AddLineToPoint(item.NearPoint.X, item.NearPoint.Y); path.AddLineToPoint(item.EndPoint.X, item.EndPoint.Y); positionAnimation.Path = path; var animationGroup = new CAAnimationGroup(); animationGroup.Animations = new CAAnimation[] { positionAnimation, rotateAnimation }; animationGroup.Duration = AnimationDuration; animationGroup.FillMode = CAFillMode.Forwards; animationGroup.TimingFunction = CAMediaTimingFunction.FromName(CAMediaTimingFunction.EaseIn); //animationgroup.delegate = self; if (Flag == MenusArray.Count - 1) { animationGroup.SetValueForKey("firstAnimation", "id"); } item.Layer.AddAnimation(animationGroup, "Expand"); item.Center = item.EndPoint; Flag++; }