简体   繁体   中英

Cancel MFMailComposeViewController's ActionSheet clipped

I've been trying to solve this all day, I upgraded my mainWindow.xib to the 4 inch iPhone 5 version, and all of my ActionSheets behave normal on the 4 inch simulator. However, if I cancel composing an E-Mail in portrait mode on 3.5 inch devices, the action sheet is not completely revealed (the Cancel button is hidden).

I appreciate any help offered.

Here is a screenshot of the issue in portrait:

一只忙碌的猫

Here is the code I'm using to display the action sheet and counter-act for the 3.5 inch screen sizes due to my mainWindow.xib being a 4 inch version now:

sheet = [[UIActionSheet alloc] initWithTitle:nil
                                                delegate:self
                                       cancelButtonTitle:@"Cancel"
                                  destructiveButtonTitle:nil
                                       otherButtonTitles:@"Share via iMessage/SMS", @"Share via E-Mail", @"Review App", nil];

            // This code is for the iPhone 5 portrait & landscape, 3.5" landscape, and iPad

            if ([[UIScreen mainScreen] applicationFrame].size.height == 548 | orientation == UIInterfaceOrientationLandscapeLeft | orientation == UIInterfaceOrientationLandscapeRight | UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
            {
                [sheet showInView:self.parentViewController.view];
            }

            // This code is for 3.5" portrait

            else
            {
                [sheet showInView:self.parentViewController.view];
                [sheet setFrame:CGRectMake(0, 220, 320, 320)];
            }

Found the solution; I had to change my mainWindow.xib size to None, and in my app delegate add this line:

self.window.frame = CGRectMake(0, 0, [[UIScreen mainScreen]bounds].size.width, [[UIScreen     mainScreen]bounds].size.height);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM