取消MFMailComposeViewController的ActionSheet剪辑

时间:2012-10-05 05:12:01

标签: iphone objective-c ios uiactionsheet mfmailcomposeviewcontroller

我一直试图解决这个问题,我将mainWindow.xib升级到4英寸iPhone 5版本,并且我的所有ActionSheets在4英寸模拟器上表现正常。但是,如果我取消在3.5英寸设备上以纵向模式撰写电子邮件,则操作表不会完全显示(取消按钮被隐藏)。

感谢您提供的任何帮助。

以下是纵向问题的屏幕截图:

a busy cat

由于我的mainWindow.xib现在是4英寸版本,下面是用于显示3.5英寸屏幕尺寸的操作表和反作用的代码:

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)];
            }

1 个答案:

答案 0 :(得分:4)

找到解决方案;我不得不将mainWindow.xib大小更改为None,并在我的app委托中添加以下行:

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