I'm trying to present an opaque UIViewController from a UINavigationController. While the view is being animated, it is opaque just how I want it. When it is done animating, however, the background turns gray. I had this working when the previous view was a UIViewController. When I used a UINavigationController as the previous view I started having this issue.
Code to switch to view:
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:STORYBOARD_IPHONE bundle:nil];
UIViewController *viewController = [storyBoard instantiateViewControllerWithIdentifier:viewName];
[self presentViewController:viewController animated:YES completion:nil];
Code to make presented view opaque:
self.view.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.7];
I think this might have something to do with the fact that the class that is presenting the view is not the UINavigationController, but a UIViewController within the UINavigationController. So I tried using self.navigationController presentViewController, but I got the same result.
How can I fix this so that the background remains opaque?
The previous UINavigationController with embedded UIViewController:
What it looks like during animation:
What it looks like after animation: