我尝试使用下面的代码进行动画我的自定义视图的运动(从Objective-C的从苹果我最好的翻译自己的文档)不能动画自定义视图
var animDict = new NSMutableDictionary();
animDict [NSViewAnimation.TargetKey] = this.View;
animDict [NSViewAnimation.StartFrameKey] = NSValue.FromRectangleF (this.View.Frame);
animDict [NSViewAnimation.EndFrameKey] = NSValue.FromRectangleF (new RectangleF (0, 150 * index, 400, 150));
var theAnim = new NSViewAnimation();
theAnim.SetValuesForKeysWithDictionary (animDict);
theAnim.Duration = 2;
theAnim.StartAnimation();
不过我在运行应用程序时出现以下运行时错误:2011-05-08 00:53:30.827 EpisodeNext [61715:613] [setValue:forUndefinedKey:]:该类不是NSViewAnimationTargetKey密钥的关键值编码。
任何想法我做错了什么?感谢名单!
Unfortuanettly做,我得到如下:错误CS1503:参数'#1' 不能转换'MonoMac.Foundation.NSMutableDictionary“表情输入'MonoMac.Foundation.NSCoder”(简单地删除SetValuesForKeysWithDictionary方法,并把animDict在NSViewAnimation的构造函数中...) – 2011-05-09 12:10:12
您是否尝试过使用“var theAnim = new NSViewAnimation(new NSMutableDictionary [] {animDict});” ? – 2011-05-09 12:30:12
这工作......虽然非常奇怪的语法(在我看来) – 2011-05-09 13:20:51