动画1
//图片开始动画 [UIView beginAnimations:nil context:nil]; //动画的时间是... typedef double NSTimeInterval;是double [UIView setAnimationDuration:(size.width+100)/30]; //动画的曲线是... 对比火车进出站 [UIView setAnimationCurve:UIViewAnimationCurveLinear]; //动画的代理是自己 [UIView setAnimationDelegate:self]; //动画结束执行的方法 [UIView setAnimationDidStopSelector:@selector(aniFinish)]; //设置内容 _label.frame=CGRectMake(-size.width, 0, size.width, size.height); //提交动画 [UIView commitAnimations];
原文:http://www.cnblogs.com/coderMJL/p/4861965.html