如何使用自定义过渡iOS7使uiview全屏ViewController [英] How to make uiview fullscreen viewcontroller using custom transitions ios7

查看:52
本文介绍了如何使用自定义过渡iOS7使uiview全屏ViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要实现的是:在轻点一些数据的小视图后,我想使其全屏显示,并有可能使其成为新的vc.

What i want to achieve is: after tapping a small view with some data i want to make it full screen and possibly make it to be a new vc.

目前,我将uiview动画化为全屏动画非常成功,但是这种视图的全部逻辑在于它的父级".

For now I animate uiview to full screen with great success, but whole logic of this view is in it's "parent".

是否可以在类似uiview的外部对viewcontroller进行动画处理(例如,例如在Android SDK中的LayoutTransitions中)?

Is it possible to animate viewcontroller out of the uiview which is similar (for. eg. like in LayoutTransitions in Android SDK)?

使用自动版式将我的uiview的示例代码显示为全屏:

Sample code of my uiview to full screen using autolayout:

            sender.view.transform = CGAffineTransformIdentity;
            [UIView animateWithDuration:0.2
                             animations:^{
                                 sender.view.frame = self.view.window.bounds;
                             } completion:^(BOOL finished) {
                                 [((CSTicketView*)sender.view) showMenu];
                             }];
            [[UIApplication sharedApplication]
             setStatusBarHidden:YES
             withAnimation:UIStatusBarAnimationFade];
            [[self navigationController] setNavigationBarHidden:YES animated:YES];

推荐答案

绝对有可能. 您可以在iOS7中使用新的视图控制器转换模型. 我绝对会建议一些资源来检查我的基本解释:

Absolutely possible. You can use the new view controller transitions model in iOS7. I would definitely recommend a few resources to check on top of my basic explanation:

  • this
  • and this
  • I have some sample code for a demonstrator of this here

最终,您将为过渡到的视图创建一个新的视图控制器,并且还使一个符合UIViewControllerAnimatedTransitioning的NSObject子类包含要在它们之间过渡的代码.听起来很复杂,但是如果您观看我链接的视频并阅读其他参考文献,那将是很有意义的.

Ultimately you make a new view controller for the view you are transitioning to, and you also make an NSObject subclass that conforms to UIViewControllerAnimatedTransitioning which contains the code to transition between them. Sounds complex but if you watch the video I linked to and read the other reference it'll make total sense.

这篇关于如何使用自定义过渡iOS7使uiview全屏ViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆