【发布时间】:2013-11-17 01:10:26
【问题描述】:
我想在 UIView 关闭时制作动画。我尝试阅读以下内容:
http://felipe.sabino.me/ios/2012/05/10/ios-uiview-transition-effects/
iPhone UIView Animation Best Practice
iOS UIView Animation CATransform3DMakeRotation confusion
但是,我想让它从屏幕一侧过渡,就像 Google Chrome 应用程序中的图像一样。
是否为此设置了另一个动画?我找不到它...我假设它与animateWithDuration 或CATransform 有关...有人可以为此指出正确的方向吗?
[编辑]
我使用以下帖子作为答案以及这篇帖子:
Setting a rotation transformation to a UIView or its layer doesn't seem to work?
我可以添加多个动画,如下所示:
[UIView animateWithDuration: .2
delay: 0
options: (UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction)
animations:^{self.view.center = CGPointMake(self.view.frame.origin.x * 3, self.view.frame.origin.y * 2), self.view.transform = CGAffineTransformMakeRotation(M_PI_4/2);}
completion:nil];
以前我不知道您可以如此轻松地添加多个动画。这将旋转和线性运动加在一起。
【问题讨论】:
标签: ios uiviewanimation