2010-08-26 126 views
2

任何人都可以帮助我添加动画子视图。我想添加像CATransition这样的动画的子视图,但是通过这个类我们只有几种不同的动画类型。但我在寻找能力来实现它自己的动画 - 在不同时间出现的不同视角。添加动画子视图

也许有存在的一些例子或者别的

+0

你是说你想要的东西不是CATransition动画?你有你想要的样品吗? – Neeku 2012-06-27 13:01:53

回答

1

您有动画

new_view.hidden=NO; 

    CATransition *transition=[CATransition animation]; 
    transition.type=kCATransitionPush; 
    transition.subtype=kCATransitionFromTop; 
    transition.duration=0.10; 
    [[new_view layer] addAnimation:transition forKey:@"animation2"]; 
1

实现了附加子视图此代码为UIView的动画:

[newView setFrame:CGRectMake(0.0f, 480.0f, 320.0f, 480.0f)]; //notice this is OFF screen! 
[UIView beginAnimations:@"animateTableView" context:nil]; 
[UIView setAnimationDuration:0.4]; 
[newView setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)]; //notice this is ON screen! 
[UIView commitAnimations]; 

还有一些建在动画中作为翻转和卷曲:

[UIView beginAnimations:nil context:nil]; 
[UIView setAnimationDuration:1.0]; 
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight 
          forView:newView 
          cache:YES]; 

[self.navigationController.view addSubview:settingsView.view]; 
[UIView commitAnimations]; 

here更多: