0
votes

I'm trying to present a view controller (which is embedded in a navigation controller) modally. The problem is that when the view is presented, it is blending the navigation bar with black rather than white.

I am creating my view controller from a storyboard and showing it by using -[UIViewController presentViewController:animated:completion:].

How can I get the correct blending as can be seen below?

Incorrect behavior:

enter image description here

Correct behavior:

enter image description here

1

1 Answers

0
votes

The problem was that the Extend Edges setting had Under Top Bars disabled. Once I enabled that setting, everything worked properly.

Note to revert to the defaults, you should enable Under Top Bars and Under Bottom Bars. The latter is especially useful if you notice the same behavior with a tool bar at the bottom of the view controller.

You can see what the value is set to programmatically by reading the edgesForExtendedLayout value on your view controller. If it is set to UIRectEdgeNone, you will get the undesirable behavior.

For more information on how extended edges works, see this answer.