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:
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];
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With