iphone - 不使用 NavigationController 的 UIViewController 的 Push-Pop 类动画

标签 iphone ios uinavigationcontroller uiviewanimation

我想在我的应用程序中实现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/

相关文章:

ios - 如何在 Apple Watch 上安装 App

iphone - QLPreviewController NavigationBar setTranslucent 属性不起作用

objective-c - 在 iOS6 中处理旋转

javascript - iPad 和 iPhone 通用应用程序的不同 CSS 样式表

iphone - 如何隐藏导航栏中的两个右侧按钮之一

ios - 核心数据进行复杂查询

ios - 在 ios swift 中将 firebase 数据添加到数组

iOS 推送通知不适用于 Firebase

ios - Objective-C : Add/Perform multiple segue in navigation controller

iphone - 如何配置 Microsoft Encoder 4 Pro 进行 http Live 流传输?