开发者

Animating an NSView frame, then jumping to specific frame

开发者 https://www.devze.com 2023-03-24 03:08 出处:网络
I\'m trying to slide a gridded NSView up, revealing another row from another NSView. Then, once the animation is done, the second NSView will dissapear, and the first will immediately move back to its

I'm trying to slide a gridded NSView up, revealing another row from another NSView. Then, once the animation is done, the second NSView will dissapear, and the first will immediately move back to its original position with the new data.

It works 4/5s of the time. The only error I'm getting is when the first view doesn't reset to the original position; it stays were the animation finishes.

Here's the basic idea (I don't have the code here):

[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
    [[myView animator] setFrame:newPos];
} completionHandler:^{
    [myView setFrame:originalPos];
}];

I'm having trouble Googling since ru开发者_开发百科nAnimationGroup:completionHandler is new in Lion.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号