iphone - 取消 MFMailComposeViewController 的 ActionSheet 剪裁

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

最佳答案

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

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

关于iphone - 取消 MFMailComposeViewController 的 ActionSheet 剪裁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12739876/

相关文章:

ios - Flutter:主屏幕上 iOS 应用程序图标上的通知角标(Badge)计数器未显示(使用 FCM)

ios - 更改导航栏色调颜色 iOS 7。

iphone - 在完成一些动画和变换后,如何将图层变换重置为原始状态?

iphone - 如何取消UISearchbar中的键盘?

iphone - 比较 Objective-C 中的 float 和 double 数据类型

iphone - 我应该在哪里将 iPhone View 中的 "save"更改为对象的 'create new'?

objective-c - 异步套接字 VS NSstream

ios - 根据通过 NSNotification 接收的索引从 TableView 中删除特定行

objective-c - 将其他正在运行的应用程序的窗口置于最前面

ios - 为什么此 Regex 代码不适用于 P.O.箱子串?