I currently have a subview covering the whole screen and with a UIButton on. When I press the button, I bring up a different view for sending an email using [self presentModalViewController:controller animated:YES]; this brings up the new view (viewcontroller) but behind the subview. If I press a button to removeFromSuperview and the subview dissapears, then the email viewcontroller is visible.
Is it possible to set a Z-index or something when using presentModalViewController?
I don’t want to remove the subview before it slides up. I want it to remain there the whole time while the user types his email etc. So when he is done, the subview still shows.
Showing the subview (which has the button on)
[self.view.superview addSubview:pinSpecsView];
Clicking the button
UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Share" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Email", @"Message", nil];
popupQuery.actionSheetStyle = UIActionSheetStyleDefault;
[popupQuery showInView:self.view];
[popupQuery release];
Showing the email controller after “email” was selected
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
....
[self presentModalViewController:controller animated:YES];
I think you should be adding pinSpecsView to self.view instead of self.view.superview.
To change Z order of subviews use sendSubviewToBack: bringSubviewToFront: methods.