uisplitviewcontroller – iOS8 MGSplitViewController替代

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

显示错误的行为.它应该像以下截图:

我读过的地方,MGSplitViewController库将不会更新为iOS8修复程序.任何人都知道,如果我们有另一个库,它适用于iOS8以及具有类似的功能与MGSplitViewController.

解决方法

我面对同样的问题,找到了一个修复.转到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,1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO];
}

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...