9
votes

Hi I wondering how should I go about placing a view such that it cover a entire UINavigationController. Basically I want to add a 0.5 alpha, black overlay to the view to give it a 'disabled' look. And the UINavigationController I'm trying to cover is the DetailViewController of the split view controller on the iPad.

I know I can add the view as a subview to the navigation controllers root view but that won't cover the navigation bar at the top.

2

2 Answers

23
votes

As i understand you want to cover all the screen with your view. May be this will help

[self.navigationController.view addSubview:coverView];
2
votes

I also tried the marked answer, but it didn't work for me. I found another solution which was simple and did it:

Insert Appdelegate

#import "AppDelegate.h"

Get Delegate, cast and add subview to main window

AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
[appDelegate.window addSubview:alertVC.view];