pankaj
pankaj

Reputation: 8388

Adding a view over iPhone window, even above UINavigationBar

I want to add a view in my UIViewController. The view must also cover the UINavigationBar. My overlay view covers the view of my app but it does not cover the navigation bar. How can I cover the navigation bar?

Upvotes: 0

Views: 822

Answers (1)

prakhar
prakhar

Reputation: 828

You can easily do this via adding the view on window

Create the reference of AppDelegate and use its window property for adding the subView. // Declare this in your .h file and then import AppDelegate.h file in your .m file

    id _AppDelegate;
    _AppDelegate=(AppDelegate *)[[UIApplication sharedApplication] delegate];
    [[_AppDelegate window] addSubview:yourView];

Upvotes: 2

Related Questions