iphone - 带有 block 的UINavigationController动画过渡

标签 iphone objective-c ios xcode objective-c-blocks

谁能告诉这个下面的代码片段等效的块动画?

[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight 
           forView:self.navigationController.view cache:NO];

NextViewController *next = [[NextViewController alloc] 
           initWithNibName:@"NextViewController" bundle:nil];

[self.navigationController pushViewController:next animated:YES];
[next release];
[UIView commitAnimations];

最佳答案

NextViewController *next = [[NextViewController alloc] initWithNibName:@"NextViewController" bundle:nil];

[UIView transitionWithView:self.navigationController.view 
                  duration:0.75 
                   options:UIViewAnimationOptionTransitionFlipFromRight 
                animations:^{
                 [self.navigationController pushViewController:next animated:NO];
                } 
                completion:nil];

关于iphone - 带有 block 的UINavigationController动画过渡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10737461/

相关文章:

ios - 如何禁用 ios 7 中的界面方向更改

ios - 为什么图像不显示在 imageview 中

java - 使用 Java 或 Objective C 以外的方式创建 native 应用程序

iphone - 如何诊断 iPad iPhone 应用程序中的 EXC_BREAKPOINT (SIGTRAP) 崩溃?

iphone - 如何使用 NSUndoManager 支持替换 UITextView 中的文本?

ios - Swift:关于协议(protocol)和委托(delegate)模式

ios - NSString boundingRect与UILabel中包含的图像字形

iphone - 撤消“为 iPad 升级当前目标?

iphone - 我无法在 iPhone 上创建联系人群组,该如何解决?

ios - 属性要求在 objective-c 中命名字段错误