How would I 'punch a hole' in a tab bar app, whereby a tab-bar based app can show a view behind the uinavigationcontrollers that are in each tab? (this punch could be optionally turned off).
My code, the the app delegate, for creating the tabs is:
OneRootViewController *oneRootViewController = [[OneRootViewController alloc] initWithNibName:@"OneRootViewController" bundle:nil];
UINavigationController *oneNav = [[UINavigationController alloc] initWithRootViewController:oneRootViewController];
oneNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"One" image:[UIImage imageNamed:@"one.png"] tag:0];
TwoRootViewController *twoRootViewController = [[TwoRootViewController alloc] initWithNibName:@"TwoRootViewController" bundle:nil];
UINavigationController *twoNav = [[UINavigationController alloc] initWithRootViewController:twoRootViewController];
twoNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Two" image:[UIImage imageNamed:@"two.png"] tag:1];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:oneNav, twoNav, nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
Here's how I'd like it to work:
-----------------------------
| |
| --------------- |
| | | |
| | hole which | |
| | shows the | |
| | same view | |
| | in each tab | |
| --------------- |
| |
| |
-----------------------------
| | |
| tab 1 | tab 2 |
| | |
-----------------------------
There's a thread here about transparent rectangles - iPhone - Draw transparent rectangle on UIView to reveal view beneath - but I'm not sure how to do it in my case.. would I subclass my nav controller or tab bar controller (is it legal to even do that), and if so, how would I make the hole optional?