Nguyen Hoang
Nguyen Hoang

Reputation: 75

How to fix default popup menu using uiactivityviewcontroller

I have problem, my app using default uiactivityviewcontroller, but it too big on iphone 6+. How to fix it ? Button in my app too big Button other app

My code

MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self;
[self presentViewController:mail animated:YES completion:NULL];

Upvotes: 0

Views: 95

Answers (1)

user3182143
user3182143

Reputation: 9609

UIAlertController *actionSheet= [UIAlertController
                             alertControllerWithTitle:nil
                             message:nil
                             preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *actionSheetDeleteDraft = [UIAlertAction
                                 actionWithTitle:@"Delete Draft"
                                 style:UIAlertActionStyleDefault
                                 handler:^(UIAlertAction * action)
                                 {
                                     NSLog(@"Delete is pressed");
                                 }];
UIAlertAction *actionSheetSaveDraft = [UIAlertAction
                                 actionWithTitle:@"Save Draft"
                                 style:UIAlertActionStyleDefault
                                 handler:^(UIAlertAction * action)
                                 {
                                     NSLog(@"Save pressed");
                                 }];
UIAlertAction *actionSheetCancel = [UIAlertAction
                                 actionWithTitle:@"Cancel"
                                 style:UIAlertActionStyleCancel
                                 handler:^(UIAlertAction * action)
                                 {
                                     NSLog(@"Cancel pressed");
                                 }];

[actionSheet addAction:actionSheetDeleteDraft];
[actionSheet addAction:actionSheetSaveDraft];
[actionSheet addAction:actionSheetCancel];
[self presentViewController:actionSheet animated:YES completion:nil];

Upvotes: 1

Related Questions