Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Segue Push Animation with Clear Background is Flashing on iOS 7

I have this simple storyboard :

enter image description here

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;
}

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.

please take a look at this video : http://www.youtube.com/watch?v=-oZc9SwPJjs

thank you

like image 918
Saint Robson Avatar asked Oct 20 '22 15:10

Saint Robson


1 Answers

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:

Change animation transition

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

Hope it helps!

like image 105
Roberto Ferraz Avatar answered Oct 23 '22 15:10

Roberto Ferraz