如何在ios中将popover设置为全屏

时间:2015-01-12 09:49:40

标签: ios fullscreen uipopovercontroller

我想制作一个到全屏的弹出窗口

popover = [[UIPopoverController alloc] initWithContentViewController:cameraUI];
[_popover presentPopoverFromRect:CGRectMake(0, 0, 0, 0) inView:self.view             
               permittedArrowDirections:UIPopoverArrowDirectionUnknown animated:YES];   

谁知道如何在ios7 / ios8

中做到这一点

1 个答案:

答案 0 :(得分:0)

好吧无论如何,如果您的问题是它没有在手机上工作,那么添加这样的类别

@interface UIPopoverController (phone)
+ (BOOL)_popoversDisabled;
@end

@implementation UIPopoverController (phone)
+ (BOOL)_popoversDisabled {
    return NO;
}
@end
然后像这样做一个弹出窗口就好了。所以再次,不确定你的实际问题是什么(如果有的话)

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType =
UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage,nil];
imagePicker.allowsEditing = NO;

UIPopoverController * popover = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
[popover presentPopoverFromRect:CGRectMake(0, 0, 0, 0) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUnknown animated:YES];