2010-06-23 65 views
0

我已经实现了一个动画应用程序。其中有一个主视图,另一个是该视图中的子视图。还有一个按钮。当用户触摸该按钮时,我想与动画显式子视图。该视图必须显示从底部到顶部。如何可能。我不知道它有可能。如何制作UIView动画?

+0

你想使用[UIView的beginAnimations:@ “身份证” 背景:无]请张贴一些代码。 – Cesar 2010-06-23 09:00:35

+0

是的,我想使用贝洛尔类型代码: CGContextRef context = UIGraphicsGetCurrentContext(); \t [UIView beginAnimations:nil context:context]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:thumbnailView cache:NO]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:thumbnailView cache:NO]; \t // [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; \t [UIView setAnimationDuration:1.0]; \t // \t self.view.hidden = YES; \t [UIView commitAnimations]; – JohnWhite 2010-06-23 09:04:43

回答

2

试试下面的代码:

[UIView beginAnimations:nil context:nil]; 
[UIView setAnimationDuration:0.75]; 

// swap the views and transition 
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp 
         forView:self.view 
         cache:YES]; 

[originalSubview removeFromSuperview]; 
[self.view addSubview:thumbnailView]; 

[UIView commitAnimations];