iOS同步动画

时间:2011-10-06 00:44:35

标签: iphone ios ipad animation

我的视图中有2张图片。只需点击一下按钮,我就可以同时将它们放在屏幕下方。我是否需要创建2个线程才能同时运行,或者有一种简单的方法可以同时生成多个动画。

教程或文档的任何链接都没问题,我可能会想到它(我试图在谷歌上搜索,但还没找到我正在寻找的东西)。

1 个答案:

答案 0 :(得分:6)

- (IBAction)moveLowerOnClick{
       [UIView beginAnimations:nil context:NULL];
       self.somethingToMove.frame = CGRectOffset(self.somethingToMove.frame, 0, 50);
       self.anotherThingToMove.frame = CGRectOffset(self.anotherThingToMove.frame, 0, 50);
       [UIView commitAnimations];
}

但是在这里:iPhone UIView Animation Best Practice是关于替补的讨论