Kazmi
Kazmi

Reputation: 593

MFMailComposeViewController's Send and Cancel Buttons are not appearing

for some reason the send and cancel buttons are not appearing, i even pasted the following code at the start of the application in appdelegate just when the app launches but still its not working. Can anybody help, thanks

mailController = [[MFMailComposeViewController alloc] init];
        mailController.mailComposeDelegate = self;
        [mailController setToRecipients:[strToEmailAddresses componentsSeparatedByString:@","]];
        [mailController setSubject:@"An Invite from MyGuide"];
        [mailController setMessageBody:@"Join me and your other friends now for free." isHTML:NO];

        if(mailController == nil)
            NSLog(@"Nil");
        else
            [self presentModalViewController:mailController animated:YES];

Upvotes: 4

Views: 1308

Answers (2)

yu0winter
yu0winter

Reputation: 11

Make sure the navgationBarHieedn be NO,which is the property of the navigationController of MFMailComposeViewController.

And I have this problem in a category of "UINavigationController" which sets navigationBarHidden as YES when pushing a new viewController.After these code edited,the cancel buttons appeared;

Upvotes: -1

fisher
fisher

Reputation: 1296

I have stumbled upon this problem myself, and for me the answer was that the buttons had a white tint (because my app has white as tintColor) which made them invisible with the navigation bar background! So they were actually there, but the color made them invisible. If this is your problem as well, you'll need to temporarily set the tintColor of the navigationBar to something else when the MailComposer is pushed on to the stack.

Upvotes: 5

Related Questions