两个UITextviews之间的动画

时间:2013-01-08 16:55:08

标签: iphone ios6

[baseview addSubview:textView1];
textView1.alpha = 0.0;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:textView1 cache:YES];
textView1.alpha = 1.0;
[UIView commitAnimations];

[baseview addSubview:textView2];
textView2.alpha = 0.0;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:textView2 cache:YES];
textView2.alpha = 1.0;
[UIView commitAnimations];

我如何在这两个文字视图之间制作动画。

感谢您的帮助

1 个答案:

答案 0 :(得分:1)

这应该可以隐藏第一个文本视图并显示第二个文本视图:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:textView1 cache:YES];
{
    textView1.alpha = 0.0;
    textView2.alpha = 1.0;
}
[UIView commitAnimations];

也许您必须将父视图设置为动画视图(例如self.view)。