padatronic
padatronic

Reputation: 98

add overlay view over all other views

how do you add an overlay view that goes over everything. eg over a tab bar controller, and a navigation controller?

thanks

Upvotes: 2

Views: 9917

Answers (3)

pheelicks
pheelicks

Reputation: 7469

Use a modal view controller. Have a read of this guide:

http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html

Presenting the view controller itself is easy:

UINavigationController *navigationController = [[UINavigationController alloc]
                         initWithRootViewController:addController];
[self presentModalViewController:navigationController animated:YES];

Upvotes: 2

progrmr
progrmr

Reputation: 77261

Add a window. That's what the popup keyboard and UIAlertView do, you can see that in this view dump.

Upvotes: 2

Paul Lynch
Paul Lynch

Reputation: 19789

Find the "top" view in your stack, and add a subview. eg

[self.tabBarController.view addSubview:myView];

The hardest part is finding the topmost view; with a tab bar, it will be its own view.

Upvotes: 2

Related Questions