【问题标题】:popover full screen in iOS 8iOS 8中的popover全屏
【发布时间】:2015-01-09 07:30:07
【问题描述】:

我有UIPopoverController 的以下代码。它在 iOS 7 中运行良好。但是,在 iOS 8 中,弹出框变成了我不想要的全屏。如何防止弹出框在 iOS8 中填满整个屏幕?

CGRect buttonFrame = [[[[[self tabBarController] tabBar] subviews] objectAtIndex:index+1] frame];

popover = [[UIPopoverController alloc]initWithContentViewController:viewmapmenu] ;

popover.popoverContentSize = CGSizeMake(95, 128.0) ;

popover.delegate = self ;

[popover presentPopoverFromRect:buttonFrame inView:self.tabBarController.tabBar permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES] ;

【问题讨论】:

    标签: ios uipopovercontroller


    【解决方案1】:

    尝试添加这个委托方法。

    - (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller;{
        return UIModalPresentationNone;
    }
    

    【讨论】:

    • UIPopoverController 更改为UIPopoverPresentationController
    【解决方案2】:

    看,情况是这样的。如果您在 iPhone 中显示弹出框,那么它将无法在 iOS 8 中使用,因为 Apple 已经完全限制了它,即使它以前可以使用。现在你不能在 iPhone 中显示 popover,因为所有对 UIPopover 私有方法的访问都被阻止了。

    您可以查看 github 中的 FPopover 库以在 iPhone 中使用 popover:- https://github.com/50pixels/FPPopover

    【讨论】:

    • 啊哈,所以它只适用于 iPad。很高兴知道这一点。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-16
    • 1970-01-01
    • 1970-01-01
    • 2015-03-08
    • 1970-01-01
    相关资源
    最近更新 更多