1
我的代码工作,我的动画,但我不知道如何做到这一点:在动画集结束时在MonoTouch中实现CAKeyFrameAnimation回调?
Animation End Callback for CALayer?
...在MonoTouch的。
这里就是我已经有了:
public partial class MyCustomView: UIView
{
// Code Code Code
private void RunAnimation()
{
CAKeyFrameAnimation pathAnimation = new CAKeyFrameAnimation();
pathAnimation.KeyPath = "position";
pathAnimation.Path = trail; //A collection of PointFs
pathAnimation.Duration = playbackSpeed;
Character.Layer.AddAnimation(pathAnimation,"MoveCharacter");
}
//Code Code Code
}
MyCustomView已经从UIView的继承和我无法从两个类继承。当完成动画时,如何调用名为“AnimationsComplete()”的函数?
好吧,这是我不能正确解释这个故障。问题是我使用的类已经从UIView继承,所以我不能从两个类继承。我会更新我的问题。 – Abel 2010-02-08 16:25:47
我认为这不重要。 CAAnimationDelegate将是一个*独立的*类。所以,你将拥有MyCustomView和MyCustomViewDelegate类。然后,在RunAnimation()中,您将拥有pathAnimation.Delegate = new MyCustomViewDelegate(); (例如)。 – dommer 2010-02-08 18:37:51
你完全正确。谢谢您的帮助! – Abel 2010-02-09 04:22:54