2

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

thanks

padatronic
  • 98
  • 2
  • 5
  • 1
    In the end i solved the problem by adding a button to the superview, this button I made to the size of the screen and this formed the background. I then put the progress view on top of it, and a cancel button. This may be a bit of a naf solution but it works great – padatronic May 17 '10 at 15:28

3 Answers3

2

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.

Paul Lynch
  • 19,769
  • 4
  • 37
  • 41
2

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

Community
  • 1
  • 1
progrmr
  • 75,956
  • 16
  • 112
  • 147
2

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];
pheelicks
  • 7,461
  • 2
  • 45
  • 50