When clicking on the MKMapView callout bubble, I trigger a
DetailsViewController *details = [[DetailsViewController alloc] initWithNibName:@"DetailsViewController" bundle:nil];
[self presentModalViewController:details animated:YES];
[details release];
In the DetailsViewController, I have set the background to transparent:
self.view.backgroundColor = [UIColor colorWithHue:0.0 saturation:0.0 brightness:1.0 alpha:0.2];
When I click on the callout, I see the animation starting (the DetailsView is appearing and is transparent) but then, when the animation is done, it’s not transparent anymore.
The problem is that when you present a new view, it takes control of the screen, so your background view dissapears.
This behaviour is correct, because imagine that you keep opening new views all the time and stacking them, the OS cannot hold all your views in background! It just simply make then dissapear.
Instead of making a new view controller appear and take control of the screen, you can just make your view appear on top of the first one.
Try with something like this, and let me know how it goes (I just made the code here, so I cannot assure you its working, but you get the idea for sure):
I’ve done this before and its possible, but I cannot assure you the stability of your app.
Other “cleaner” solution, is making your new view part of the old one. You can set it in the bottom (hidden), so the user dont see it, and when you want it you use a animation to put it in the main screen. The problem is that you will have the merge the 2 controllers in one.