I got the problem with the cancel button of MFMailComposeViewController. Here is my context
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
- (IBAction)showButtonDidTouch:(id)sender {
if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
mailViewController.mailComposeDelegate = self;
mailViewController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:mailViewController animated:YES];
[mailViewController release];
}
}
I hid status bar at viewDidLoad and then called displayed mailViewController as present modal view controller. However, the problem is when the app in landscape mode and uikeyboard appears, the action sheet doesn’t show up when cancel button is tapped as image: http://img651.imageshack.us/img651/5489/screenshot20120514at114.png
The little red image at top-left corner is the action sheet. If I set statusbarhidden = NO, it shows up.
I appreciate your help, thank you
I was able to work around this issue (which I see as an iOS bug) by registering for UIKeyboardWillShowNotification. Whenever the keyboard is shown, I manually set the frame of my MFMailComposeViewController’s superview to +/- 20 (status bar height), depending on the orientation (landscape left or right). This is a pretty ugly hack, but it works for me for now.