Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a view above a UINavigationController?

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.

like image 846
gossainapps Avatar asked Mar 14 '12 04:03

gossainapps


2 Answers

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

[self.navigationController.view addSubview:coverView];
like image 187
B.S. Avatar answered Nov 06 '22 16:11

B.S.


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];
like image 23
Alex Cio Avatar answered Nov 06 '22 18:11

Alex Cio