Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS7 UIModalTransitionStyleFlipHorizontal bounces after transition

I'm updating my app for iOS 7 and I discovered a weird problem. I'm presenting a UIViewController wrapped in a UINavigationController with UIModalTransitionStyleFlipHorizontal.

In iOS 6 it works fine, but in iOS 7 the navigation bar bounces after the transition. Does this have something to do with the status bar? I've set translucency of the main navigation bar to NO.

In the Info.plist, View controller-based status bar appearance is set to NO.

And here is a GIF showing the problem in a minimal demo app:

enter image description here

Here is my code:

feedNavigationController = [[UINavigationController alloc] init]; feedNavigationController.navigationBar.translucent = NO;  SettingsViewController *settingsVC = [[SettingsViewController alloc] init];  feedNavigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [feedNavigationController setViewControllers:[NSArray arrayWithObjects:settingsVC, nil]];  [self presentViewController:feedNavigationController animated:YES completion:nil]; 
like image 914
Rene Avatar asked Sep 13 '13 08:09

Rene


1 Answers

This appears to be a UIKit bug. The following workaround seems to resolve the issue for me.

- (void)viewWillAppear:(BOOL)animated {     [super viewWillAppear:animated];      [self.navigationController.navigationBar.layer removeAllAnimations]; } 

(Place this in the view controller you are transitioning to).

like image 128
Ben Packard Avatar answered Sep 18 '22 13:09

Ben Packard