参考代码:
[UIView beginAnimations:@"animationID" context:nil];
[UIView setAnimationDuration:0.3];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationRepeatAutoreverses:NO];
m_image.frame = CGRectMake(0, 0, 1024, 768);
[UIView setAnimationDelegate:self];//设置动画的委托
[UIView commitAnimations];//开始动画
动画的委托并不多。
//动画结束后调用的函数
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
for(UIView *m_view in [self.view subviews])
{
if ([m_view isKindOfClass:[UIImageView class]])
{
[m_view removeFromSuperview];
}
}
}
THE END !