Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS8 UINavigationController push/pop with transparent UIView issue

I noticed in iOS8, when I'm pushing a new UIViewController in a UINavigationController, the old UIViewController slides out but is visible in my new top foreground UIViewController if it has a non opaque background.

When the push is done, the old controller just disappears, leaving the whole animation looking rough.

Previous to iOS8 you would not see the view behind the one getting pushed in even if it was transparent. As if there was a mask that slid in as well. Anyone know of a good way to fix this so it's like the old behavior without re-implementing the entire push animation with a custom animation?

enter image description here

like image 366
paranoidroid Avatar asked Sep 16 '14 07:09

paranoidroid


1 Answers

It's not a bug, it's standard behavior of UINavigationController.

During push transition, UINavigationController slide first controller slower than second. After animation of second contoroller finished, UINavigationController remove first view controller. If second view controller has transparent background, you see first controller during transition.

You have 3 ways to reach your goal:

  1. Add the same background (not transparent) to second ViewContorller.
  2. Create custom transition, like described here: Navigation controller custom transition animation
  3. Make transitions by using UIView animation.
like image 170
Igor Avatar answered Nov 19 '22 12:11

Igor