簡體   English   中英

iOS 8中的popover全屏

[英]popover full screen in iOS 8

我有一個UIPopoverController的以下代碼。 它在iOS 7中運行良好。但是,在iOS 8中,popover變為全屏我不想要。 如何防止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] ;

嘗試添加此委托方法。

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

看,這是情況。 如果你在iPhone上展示popover,那么它將無法在iOS 8中運行,因為Apple已完全限制它,即使它之前正在運行。 現在,您無法在iPhone中顯示popover,因為阻止了對UIPopover的私有方法的所有訪問。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM