1
我想沿着路徑爲視圖設置動畫。當它從路徑的開始移動到結束時,我也希望它可以放大。要開始,我將縮放比例應用於視圖(.1比例)。沿着路徑移動的效果很好,但我在動畫過程中應用了從縮放到正常的轉換時遇到了問題。CAKeyAnimation with CATransform3D
PointF p0 = pt;
PointF p3 = FormCenter;
CGPath path = new CGPath();
path.MoveToPoint(p0);
path.AddQuadCurveToPoint(p3.X, p0.Y, p3.X, p3.Y);
CAKeyFrameAnimation a = new CAKeyFrameAnimation();
a.KeyPath = "position";
a.Path = path;
a.Values = new NSObject[1] {NSValue.FromCATransform3D(CATransform3D.Identity)};
a.Duration = 3;
nav.View.Layer.AddAnimation(a, a.KeyPath);