具有清晰背景的Segue Push动画在iOS 7上闪烁 [英] Segue Push Animation with Clear Background is Flashing on iOS 7

查看:160
本文介绍了具有清晰背景的Segue Push动画在iOS 7上闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个简单的故事板:

I have this simple storyboard :

所有这些UIViewController背景都清晰(透明),但我使用以下代码将背景图像作为导航栏和窗口背景:

all of those UIViewController background are clear (transparent), but I put background image as navigation bar and window background using this code :

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{      
    // window background
    self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"window"]];

    // navbar background
    UIImage *navBackgroundImage = [UIImage imageNamed:@"navbar_bg"];
    [[UINavigationBar appearance] setBackgroundImage:navBackgroundImage forBarMetrics:UIBarMetricsDefault];
    [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
    return YES;
}

通常此代码适用于iOS 6而不会闪烁,但今天当我尝试在iOS 7上构建它,segue动画(推送)正在闪烁。似乎UIViewController背景并不完全透明。

usually this code works on iOS 6 without flashing, but today when I try to build it on iOS 7, the segue animation (push) is flashing. It seems that the UIViewController background is not fully transparent.

请看一下这个视频: http://www.youtube.com/watch?v=-oZc9SwPJjs

谢谢

推荐答案

我前段时间面临同样的问题,查看具有透明背景的控制器会产生这种效果,实际上并非如此flash,它是在另一个视图上滑动的视图的动画。解决这个问题的唯一方法是删除推送的动画,实际上我认为你不需要这个动画,所以看看这个问题的答案,它显示了如何改变它:

I faced the same problem some time ago, view controllers with transparent background makes this "effect", that actually is not a flash, it is the animation of the view sliding over the other view. The only way to solve this is removing the animation of the push, indeed I don't think you need this animation, so take a look on the answer of this question, it shows how to change it:

更改动画转换

或者看看这个,他有一个示例代码,你可以下载并看看它是如何工作的:

Or take a look on this, he has a sample code, that you can just download and see how it works:

http://www.captechconsulting.com/blog/tyler -tillage / ios-7-tutorial-series-custom-navigation-transitions-more

希望它有所帮助!

这篇关于具有清晰背景的Segue Push动画在iOS 7上闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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