我整天都在尝试解决这个问题,我将 mainWindow.xib 升级到了 4 英寸 iPhone 5 版本,并且我所有的 ActionSheets 在 4 英寸模拟器上都表现正常。但是,如果我取消在 3.5 英寸设备上以纵向模式撰写电子邮件,则操作表不会完全显示(取消按钮被隐藏)。
我感谢提供的任何帮助。
这是纵向问题的屏幕截图:
由于我的 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/