我在我的应用程序中使用MGSplitViewController库。直到UIPopoverController iOS7,它才能正常工作,但是对于 iOS8 来说,它并没有像预期的那样工作,因为在iOS8中的行为发生了变化。附件是在MGSplitView上运行iOS8代码的屏幕截图:

这表明了错误的行为。它应该类似于以下截图:

我在某个地方读到,MGSplitViewController库不会为iOS8 fixes.Does进行更新,任何人都知道,如果我们有另一个库,它也适用于iOS8,并且具有与MGSplitViewController类似的特性。
发布于 2014-09-25 14:26:37
我也面临着同样的问题,并找到了解决办法。转到MGSplitViewController.m并在-splitViewSizeForOrientation:中找到以下行(围绕第261行):
width = height;
height = fullScreenRect.size.width;确保它不会在iOS 8上运行,因为iOS 8将正确处理大小。也许像这样。
if (SYSTEM_VERSION_LESS_THAN(@"8.0") && UIInterfaceOrientationIsLandscape(theOrientation)) {
width = height;
height = fullScreenRect.size.width;
}然后在-reconfigureForMasterInPopover:中找到以下行(围绕第614行):
[_hiddenPopoverController presentPopoverFromRect:CGRectMake(-2000, -2000, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO];并确保它不会在iOS 8上运行。同样,也许是这样。
if (SYSTEM_VERSION_LESS_THAN(@"8.0")) {
[_hiddenPopoverController presentPopoverFromRect:CGRectMake(-2000, -2000, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO];
}发布于 2014-09-13 10:32:50
我已经修改了MGSplitViewController以处理过去的问题,因此这可能不会完全解决您的问题,因为控制器副本中的其他修复可能会对解决方案有所贡献。
问题是,UIPopoverViewController (用于MGSplitViewController中的_hiddenPopoverViewController )在调用willAnimateRotationToInterfaceOrientation之后调用masterViewController上的视图removeFromSuperview。为了使我的应用程序再次发挥功能,我现在的修复方法是修改MGSplitViewController didRotateFromInterfaceOrientation:如下所示:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
[self.masterViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
[self.detailViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
if([[[UIDevice currentDevice] systemVersion] hasPrefix:@"8"]) {
[self layoutSubviewsForInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation withAnimation:YES];
}
}不幸的是,masterViewController视图是在旋转之后添加到MGSplitViewController视图中的,因此它看起来有点“笨重”,但是它至少可以工作。
https://stackoverflow.com/questions/25246365
复制相似问题