我整天都在尝试解决问题,我将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的大小更改为“无”,然后在我的应用程序委托中添加以下行:

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

10-08 08:03
查看更多