views:

26

answers:

0

A completely ordinary setup: UIViewController where I push another UIVC:

BlahVc *blah = [[BlahVc alloc] initWithNibName:@"Blah" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:blah];
blah.delegate = self;
[self presentModalViewController:nav animated:YES];
[nav release];
[blah release];

Details about Blah: to support both landscape and portrait with least effort, I built Blah.xib so that inside Blah's main view, call it view A, there is another view B, with width fixed to 320px, that positions itself in the centre of the screen. With portrait iPhone it fills up the whole screen, with landscape there are margins on the side. So far, so good. Autorotate etc works well.

Now, to dismiss blah, I use the recommended setup: inside Blah, I do:

[self.delegate blahDidCancel:self];

And in the parent VC, I have:

- (void)blahDidCancel:(Blah *)blah {
    [self dismissModalViewControllerAnimated:YES];
}

Both view A's and B's backgrounds are opaque white.

Problem: as soon as it hits the dismissModalViewControllerAnimated line, view A seems to become transparent, while view B remains white. This is not a problem in portrait since view B still fills up the screen. But in landscape, the result is that view B is still opaque, but has see-through transparent margins on the side (where view A used to be that has now mysteriously become transparent), from where the parent view contents comes through during the dismissing animation.

Why does it seem like view A becomes transparent upon dismissing the modal VC?