UIPopoverController没有在iOS iOS 8中展示 [英] UIPopoverController not presenting in iPad iOS 8
本文介绍了UIPopoverController没有在iOS iOS 8中展示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在iOS 8 iPad中使用 UIPopoverController
imagepicker
.Its在iOS 7中工作但在iOS 8中没有。弹出窗口没有显示,并立即调用 popoverControllerDidDismissPopover
。请建议一个解决方案..
这里的代码使用:
I am using UIPopoverController
in iOS 8 iPad for imagepicker
.Its working in iOS 7 but not in iOS 8.The popover is not displayed and popoverControllerDidDismissPopover
is called immediately.Please suggest a solution..
Here the code am using:
UIPopoverController *popVC= [[UIPopoverController alloc] initWithContentViewController:pickerController];
_pop = popVC;
_pop.delegate = self;
[_pop presentPopoverFromRect:attachBtnFrame inView:_sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO];
谢谢..
推荐答案
终于找到了解决方案:
在主线程中显示Popover,如下所示。
Finally found the solution: Present the Popover in main thread as below.
if([[[UIDevice currentDevice] systemVersion] floatValue]>=8.0)
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[_pop presentPopoverFromRect:attachBtnFrame inView:_sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:NO];
});
}
这篇关于UIPopoverController没有在iOS iOS 8中展示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文