Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 7 UINavigationController Push animation shadow

With iOS 7 a new push animation was created, which slides the pushed view controller on top of the hierarchy. But when the animation happens, iOS apparently does two things to modify the design of the top view controller:

A shadow is added:

A shadow of view controller when animating

And a light overlay over the bottom view controller:

A light overlay

In most applications this is not a problem. But, I am currently working on an application with pixel perfect design and I use view controllers with clear background. But this functionality remains the same, and the light overlay appears over the view controller. Because the background is a white gradient, this light overlay (on screenshot 2) is very visible and when the animation completes, it is removed without animation, which makes it very noticeable and annoying.

I am aware I can create custom animations and transitions, but I am wondering:

Is there any way to remove (or modify) this light overlay and shadow, without having to create custom transitions?

Thank you for your help.

like image 461
Legoless Avatar asked Dec 17 '13 15:12

Legoless


2 Answers

It's not the most elegant solution, but I've seen people use UIImage animations to show what they want shown. So, you could:

  • Screenshot the incoming UIViewController
  • Animate the arrival of a UIImageView
  • Call pushViewController:animated:, passing NO for animated:
  • Remove the UIImageView
  • Again, a bit of a hack, but maybe it's the best solution for your scenario.

    like image 130
    mbm29414 Avatar answered Nov 06 '22 07:11

    mbm29414


    Try this proxy

    [[UIImageView appearanceWhenContainedIn:NSClassFromString(@"_UIParallaxDimmingView"), nil] setAlpha:0.0f];
    

    I don't know if Apple allows this or not because it uses a private API. Will update when app submitted.

    like image 35
    Gaston Morixe Avatar answered Nov 06 '22 07:11

    Gaston Morixe