2012-03-15 73 views
0

我可以看到很多过渡动画:从左到右,从右到左,渐隐,但是我怎样才能从上到下过渡?如何让幻灯片放下过渡动画?

感谢所有帮助

+0

http://stackoverflow.com/questions/6605959/implement-custom-animation-to-present-modal-view- from-specified-view-on-ipad – 2012-03-15 08:01:21

+0

http://stackoverflow.com/questions/7188584/complete-list-of-transitions-you-can-do-between-views-on-iphone-ipad/7328633#7328633 – chikuba 2012-03-15 08:12:03

回答

0
[[self navigationController] presentModalViewController:modalViewController animated:YES]; 

和隐藏像这样:

[self.navigationController dismissModalViewControllerAnimated:YES]; 
+0

是的,我也使用类似的东西,但无法找到让它从上到下移动的方式 – user1035877 2012-03-15 08:17:11

+0

看到这个链接.. http://stackoverflow.com/questions/237310 /何灿的i-变化的动画风格对的一模态-的UIViewController – 2012-03-15 08:19:01

0

你可以使用的Core Animation,您使用的是什么样的对象呢?

基本上,你这样做的目的是淡化:

[[objectName animator] setOpacity: 1]; 

记住,你首先需要在动画开始之前,设置不透明度为0等。 希望这是你想要的。

0

您将视图框设置为离开屏幕的起始位置,然后使用某些动画将您的框架放置到位。

CGRect originalFrame = [detailsView frame]; 
CGRect offscreenFrame = originalFrame; 
offscreenFrame.origin.y -= offscreenFrame.size.height; 
detailsView.frame = offscreenFrame; //Send the frame above screen   

//Add view here if necessary to an unscrew view 
// [aSuperView addSubview:detailsView]; 

[UIView beginAnimations:@"BringIn" context:nil]; 
[UIView setAnimationDuration:.3]; 
[UIView setAnimationDelegate:self]; 
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; 
detailsView.frame = originalFrame 
[UIView commitAnimations]; 
2

尝试修好这... 添加QuartzCore框架

#import <QuartzCore/QuartzCore.h> 

CATransition *transDown=[CATransition animation]; 
[transDown setDuration:0.5]; 
[transDown setType:kCATransitionPush]; 
[transDown setSubtype:kCATransitionFromBottom]; 
[transDown setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 

[Boottom_view.layer addAnimation:transDown forKey:nil];