Ios7 在iOS 7的模式视图或表单表中显示UIImagePickerController?

Ios7 在iOS 7的模式视图或表单表中显示UIImagePickerController?,ios7,uiimagepickercontroller,modalviewcontroller,Ios7,Uiimagepickercontroller,Modalviewcontroller,我还不擅长在代码中创建视图,所以这可能是一个简单的问题 在我的iPad应用程序中,我有一个图像选择器,我想在屏幕中心的500x500模式视图或表单中心屏幕中显示它: _imagePicker = [[UIImagePickerController alloc] init]; _imagePicker.delegate = self; _imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; _imagePic

我还不擅长在代码中创建视图,所以这可能是一个简单的问题

在我的iPad应用程序中,我有一个图像选择器,我想在屏幕中心的500x500模式视图或表单中心屏幕中显示它:

_imagePicker = [[UIImagePickerController alloc] init];
_imagePicker.delegate = self;
_imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
_imagePicker.allowsEditing = NO;
_imagePicker.navigationBar.tintColor = [UIColor redColor];
_imagePicker.navigationBar.backgroundColor = [UIColor greenColor];
现在,我该如何创建模态视图或表单并在其中显示图像选择器


(我看了很多例子和问答,找不到简单的答案。谢谢你的帮助!)

表单是一种模式演示类型。您可以通过在演示之前修改视图控制器的
modalPresentationStyle
属性来更改该属性

_imagePicker.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:_imagePicker animated:YES completion:nil];
但是,如果您阅读,您将看到,Apple要求您在popover中显示视图控制器

因此:


啊哈,我明白了,利奥·纳坦!好吧,我正试图让它在我的popover中按我想要的方式工作,但是启动它的按钮不在栏上(它在表视图的静态单元格中),我的popover箭头也不能正常工作。我会继续努力的。我的popover问题列在这里:@Kent请看我对你问题的回答。
if([_popoverController popoverVisible])
{
    [_popoverController dismissPopoverAnimated:NO];
    _popoverController = nil;
}
_popoverController = [[UIPopoverController alloc] initWithContentViewController:_imagePicker];
[_popoverController setDelegate:self];
[_popoverController presentPopoverFromBarButtonItem:_button permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];