我想在我的应用程序中实现Push/Pop 类的动画。目前在我的应用程序中,我只是使用 addsubview 和 removesubview 添加和删除 viewcontroller,没有任何动画。
添加导航 Controller 将是应用程序的重大变化,因为它将改变应用程序的整体结构。有什么方法可以使用导航 Controller 来实现这种动画。
最佳答案
试试这个
首先给你的 subview 一个框架
secondview.frame=CGRectMake(330, 0, 320, 460);
然后在添加的时候
[self.view addSubView:secondview];
[UIView beginAnimations:@"bringViewDown" context:nil];
[UIView setAnimationDuration:0.2];
firstview.frame=CGRectMake(-330, 0, 320, 460);
secondview.frame=CGRectMake(0, 0, 320, 460);
[UIView commitAnimations];
希望这对你有帮助......
关于iphone - 不使用 NavigationController 的 UIViewController 的 Push-Pop 类动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14396308/