所以刚开始将我的IOS代码转换到IOS7,遇到了一些问题.

我有一个UINavigationController,它有子视图控制器,我用pushViewController来显示下一个视图.要使用一组图像创建视差动画,如果自定义UINavigationController以设置UIImageViews组的动画,则"我的子元素"视图控制器都有self.backgroundColor = [UIColor clearColor],透明度.

自iOS7以来,通过部分移动当前的视图控制器并在顶部按下新的视图控制器,UINavController子vc的动画方式得到了更新,我的视差动画看起来糟透了.我看到前一个VC移动了一点,然后消失了.有什么方法可以恢复以前的UINavigationController pushViewController动画吗?我在代码里找不到这个.

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

甚至try 使用:

    [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行为的解决方案.当我快写完的时候,我遇到了尼克·洛克伍德的解决方案:

https://github.com/nicklockwood/OSNavigationController

OSNavigationController是UINavigationController的开源重新实现.它目前只提供了UINavigationController功能的一个子集,但长期目标是复制100%的功能.

OSNavigationController并不是真正打算按原样使用.它的 idea 是,你可以用fork 叉它,然后很容易地定制它的外观和行为,以适应你的应用程序可能具有的任何特殊要求.定制OSNavigationController比try 定制UINavigationController简单得多,因为代码是开放的,您不需要担心私有方法、未记录的行为或版本之间的实现更改.

通过用他的代码覆盖我的UINavigationController,我可以在UINavigationController中处理背景图像

谢谢

Objective-c相关问答推荐

try 从 id 确定类的类型时,Objective-C消息传递不合格的 id

当 UITextField 成为第一响应者时如何使 UIScrollView 自动滚动

防止同时多个按钮

UILabel:你如何设置字体大小?

在 UITableViewCells 上显示复制弹出窗口的简单方法,如地址簿应用程序

从 NSString 创建 SHA1 哈希

如何获取 AppIcon 的 UIImage?

Objective-C 的 Eclipse 插件?

参考代码中的内部版本号或版本号

未找到 RKObjectMapping.h

UIFont 的磅值到底是多少?

自定义 UINavigationBar 背景

alloc 和 allocWithZone: 有什么区别?

我应该使用 NSUserDefaults 还是 plist 来存储数据?

Objective-C:前向类声明

UITableViewCell 点击展开

iOS 7 中的 UITextView 链接检测

更改 UITextField 占位符字体

如何将 printf 与 NSString 一起使用

在 iOS 6.0 的 Xcode 4.5 中我没有要求的日志(log)消息