I've noticed that when I segue to a Naviagtion Controller, the navigation bar jumps slightly right after the flip animation completes.
It only does this when I use a flip horizontal segue, and not when I use the default slide up animation.
Here is a GIF I've made to illustrate the problem (sorry about the tiny size!):
http://i.imgflip.com/3ym0y.gif
Take note of the Nav bar with the title "Modal" -- notice it jumps down ~20 pixels after the animation.
The example above was created with a fresh project -- I have not subclased UINavigationController or UINavigationBar. Here is the storyboard, in case it helps:
http://i.imgur.com/qFlK2oB.jpg
What am I missing?
Tapping the back button in the navigation bar at the top of the interface removes the top view controller, thereby revealing the view controller underneath. Use a navigation interface to mimic the organization of hierarchical data managed by your app.
Hi, in ios, the default height of navigation bar is 44 pts.
A user changes the navigation bar's style, or UIBarStyle , by tapping the “Style” button to the left of the main page. This button opens an action sheet where users can change the background's appearance to default, black-opaque, or black- translucent.
According to Apple documentation, "An iOS Navigation bar appears at the top of an app screen, below the status bar, and enables navigation through a series of hierarchical app screens.
Add this to viewWillAppear
in the controller you're presenting modally:
- (void)viewWillAppear:(BOOL)animated
{
// Workaround #1 for jumpy navbar
[self.navigationController.navigationBar.layer removeAllAnimations];
}
And when dismissing the controller (so in the same controller as above):
// Workaround #2 for jumpy navbar
[UIView transitionWithView:self.navigationController.view
duration:0.75
options:UIViewAnimationOptionTransitionFlipFromLeft
animations:nil
completion:nil];
[self dismissViewControllerAnimated:YES completion:nil];
See https://stackoverflow.com/a/19265558/254603
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