有没有办法让NSAnimation“从当前状态开始”?喜欢在iPhone上?
我想让视图移动到窗口调整大小的不同位置。我目前在接收NSWindowDidResizeNotification时使用NSViewAnimation执行此操作。
// Create the view animation object.
theAnim = [[NSViewAnimation alloc] initWithViewAnimations:animation];
// Set some additional attributes for the animation.
[theAnim setDuration:1]; // One and a half seconds.
[theAnim setAnimationCurve:NSAnimationEaseIn];
[theAnim setFrameRate:20.0];
[theAnim setAnimationBlockingMode:NSAnimationNonblocking];
// Run the animation.
[theAnim startAnimation];
// The animation has finished, so go ahead and release it.
[theAnim release];
(“动画”是一个带有dict的数组,其中包含我的视图的新rect,就像NSAnimation想要的那样)
调整窗口大小时,会多次调用此代码。因此,在调整大小时,一次调整大小会调用大约20次。我现在有20个动画视图移动。 20个不同的重叠。 (它看起来像许多不同的视图,但我认为它在动画之间跳跃相同)
在iPhone上只有视图移动,我可以设置[UIView setAnimationBeginsFromCurrentState:YES],它会工作。有没有办法在OSX上执行此操作?
我可以在视图上创建一个isAnimating变量,但之后它只会移动到一个位置,并且在动画时会忽略快速调整大小。
我如何在OSX上执行此操作?
谢谢
没有找到相关结果
已邀请:
1 个回复
秃拳割