gpt4 book ai didi

iphone - 图像选择器弹出框

转载 作者:行者123 更新时间:2023-11-29 13:32:47 25 4
gpt4 key购买 nike

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 按钮时,它删除了我的 View Controller 而不是图像选择器。请帮助。我在弹出窗口中显示它,因为我认为,这就是为什么它变慢的原因,因为图像选择器应该与 iPad 的弹出窗口一起出现。

最佳答案

您是否正在实现 AGImagePickerController 委托(delegate)?

- (void)agImagePickerController:(AGImagePickerController *)picker didFinishPickingMediaWithInfo:(NSArray *)info;

在那里你可以关闭你的UIPopoverController

关于iphone - 图像选择器弹出框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11444465/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com