UIView *line = [[UIView alloc] initWithFrame:CGRectMake((viewWidth - width)/2, origin_y, width, 1)];
[self.view addSubview:line];
line.backgroundColor = [UIColor redColor];
[UIView beginAnimations:@"animationID" context:NULL];
[UIView setAnimationDuration:4];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:line cache:YES]; // 这句话估计得注释掉才行,有一次就因为这句话出现个小问题
[UIView setAnimationRepeatCount:100];
[line setFrame:CGRectMake((viewWidth - width)/2, origin_y+width, width, 1)];
[UIView commitAnimations];
[line release];
[self.view addSubview:line];
line.backgroundColor = [UIColor redColor];
[UIView beginAnimations:@"animationID" context:NULL];
[UIView setAnimationDuration:4];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:line cache:YES]; // 这句话估计得注释掉才行,有一次就因为这句话出现个小问题
[UIView setAnimationRepeatCount:100];
[line setFrame:CGRectMake((viewWidth - width)/2, origin_y+width, width, 1)];
[UIView commitAnimations];
[line release];
本文介绍了一个iOS应用中创建动画效果的具体实现方式,包括通过UIView动画方法设置动画的时长、曲线类型、重复次数等参数,并演示了如何改变UIView的位置来实现动画效果。
367

被折叠的 条评论
为什么被折叠?



