简体   繁体   English

iOS 8中的popover全屏

[英]popover full screen in iOS 8

I have the following code for a UIPopoverController . 我有一个UIPopoverController的以下代码。 It is working fine in iOS 7. However, in iOS 8, the popover becomes full-screen which I do not want. 它在iOS 7中运行良好。但是,在iOS 8中,popover变为全屏我不想要。 How do I keep the popover from filling the entire screen in iOS8? 如何防止popover在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] ;

Try to add this delegate method. 尝试添加此委托方法。

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

See, here is the situation. 看,这是情况。 if you are presenting the popover in iPhone then it will not work in iOS 8 as Apple has completely restricted it even if it was previously working. 如果你在iPhone上展示popover,那么它将无法在iOS 8中运行,因为Apple已完全限制它,即使它之前正在运行。 Now you cannot present popover in iPhone as all the access to the private methods of UIPopover is blocked. 现在,您无法在iPhone中显示popover,因为阻止了对UIPopover的私有方法的所有访问。

You can look into the FPopover Library in github to use popover in iPhone:- https://github.com/50pixels/FPPopover 您可以在github中查看FPopover库以在iPhone中使用popover: - https://github.com/50pixels/FPPopover

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM