AGImagePickerController *imagePickerController = [[AGImagePickerController alloc] initWithFailureBlock:^(NSError *error) {
if (error == nil)
{
NSLog(@"User has cancelled.");
[self dismissModalViewControllerAnimated:YES];
} else
{
NSLog(@"Error: %@", error);
// Wait for the view controller to show first and hide it after that
double delayInSeconds = 0.5;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
[self dismissModalViewControllerAnimated:YES];
});
}
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];
} andSuccessBlock:^(NSArray *info) {
NSLog(@"Info: %@", info);
[self dismissModalViewControllerAnimated:YES];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];
}];
popover = [[UIPopoverController alloc] initWithContentViewController:imagePickerController];
[popover presentPopoverFromRect:CGRectMake(0.0, 0.0, 400.0, 400.0)
inView:self.view.window
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
能够展示它,但是,即使我改变了它的大小,它仍然是一样的,当我按下DONE
按钮时,它会删除我的视图控制器而不是图像选择器。请帮忙。我在弹出窗口中呈现它,因为我认为,这就是为什么它会变慢,因为 imagepicker 应该与 iPad 的弹出窗口一起出现。