我正在开发一个应用程序,当UIAlertView
呈现相机时,我需要UIImagePickerController
出现在后台。目前,当出现相机控制器时,UIAlertView
显示为超级视图(在相机上方)。
赞赏我们的想法。
答案 0 :(得分:0)
您可以展示alertView
,然后展示ImagepickerController
。所以,当你忽略imagePickerController
时,你会在viewController上看到alertView。
答案 1 :(得分:0)
AlertViews被添加到窗口而不是控制器。他们永远是最重要的。您可以在警报视图中显示选择器以重叠它。 你可以使用这个库 https://github.com/wimagguc/ios-custom-alertview
UIImagePickerController *cameraView = [[UIImagePickerController alloc] init];
cameraView.sourceType = UIImagePickerControllerSourceTypeCamera;
cameraView.showsCameraControls = NO;
CustomIOSAlertView *alertView = [[CustomIOSAlertView alloc] init];
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screen.size.width, screen.size.height)];
[container addSubview:cameraView.view];
container.subviews.lastObject.center = CGPointMake(container.subviews.lastObject.center.x, container.center.y);
[alertView setContainerView:container];
[alertView setDelegate:self];
// Display the dialog
[cameraView viewWillAppear:YES]; // trickery to make it show
[cameraView viewDidAppear:YES];
[alertView show];