恢复iOS7之前的UINavigationController pushViewController动画 [英] Restore pre-iOS7 UINavigationController pushViewController animation

查看:134
本文介绍了恢复iOS7之前的UINavigationController pushViewController动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此。刚开始将我的IOS代码转换为IOS7,并遇到了一些问题。

So. Just started transitioning my IOS code to IOS7, and ran into a bit of problem.

我有一个 UINavigationController ,它有子ViewControllers,我正在使用 pushViewController 来显示下一个视图。要创建包含一组图像的视差动画,如果自定义 UINavigationController 来设置一组 UIImageViews 和我的孩子的动画ViewControllers都有一个 self.backgroundColor = [UIColor clearColor] ,透明度。

I've got a UINavigationController, which has child ViewControllers and I'm using pushViewController to display the next views. To create a parallax animation with a set of images, if customized the UINavigationController to animate a set of UIImageViews and my child ViewControllers all have a self.backgroundColor = [UIColor clearColor], transparency.

从iOS7开始,通过部分移动当前视图控制器来更新 UINavController 为子vc设置动画的方式并且在推动新视图控制器的顶部,我的视差动画看起来很糟糕。我看到之前的VC移动了一点然后消失了。有什么办法可以恢复以前的 UINavigationController pushViewController动画吗?我似乎无法在代码中找到它。

Since iOS7, the way the UINavController animates it child vc's, is updated, by partially moving the current view controller and on top pushing the new viewcontroller, my parallax animation looks crap. I see the previous VC move a bit and then disappear. Is there any way I can restore the previous UINavigationController pushViewController animation? I can't seem to find this in the code.

WelcomeLoginViewController* welcomeLoginViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"WelcomeLogin"];
    [self.navigationController pushViewController:welcomeLoginViewController animated:YES];    

即使尝试使用:

    [UIView animateWithDuration:0.75
                     animations:^{
                         [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
                         [self.navigationController pushViewController:welcomeLoginViewController animated:NO];
                         [UIView setAnimationTransition:<specific_animation_form> forView:self.navigationController.view cache:NO];
                     }];

有没有人有任何线索?

推荐答案

谢谢大家的反馈。找到完全重新创建UINavigationController行为的解决方案。当我快完成时,我遇到了Nick Lockwood的解决方案:

Thanks guys for the feedback. Found a solution in completely recreating the UINavigationController's behavior. When I was nearly finished I ran into Nick Lockwood's solution:

https://github.com/nicklockwood/OSNavigationController

OSNavigationController是UINavigationController的开源重新实现。它目前仅具有UINavigationController功能的一部分,但长期目标是复制100%的功能。

OSNavigationController is a open source re-implementation of UINavigationController. It currently features only a subset of the functionality of UINavigationController, but the long-term aim is to replicate 100% of the features.

OSNavigationController实际上并不打算使用原样。我们的想法是,您可以将其分叉,然后轻松自定义其外观和行为,以满足您的应用可能具有的任何特殊要求。自定义OSNavigationController比尝试自定义UINavigationController简单得多,因为代码是打开的,您不需要担心私有方法,无证件行为或版本之间的实现更改。

OSNavigationController is not really intended to be used as-is. The idea is that you can fork it and then easily customize its appearance and behaviour to suit any special requirements that your app may have. Customizing OSNavigationController is much simpler than trying to customize UINavigationController due to the fact that the code is open and you don't need to worry about private methods, undocumented behavior, or implementation changes between versions.

通过用他的代码覆盖我的UINavigationController,我能够在UINavigationcontrollers中使用背景图像

By overriding my UINavigationController with his code, I was able to work with background images in UINavigationcontrollers

谢谢!

这篇关于恢复iOS7之前的UINavigationController pushViewController动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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