图像拾取酥料饼

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。请帮助。我把它放在popover中,因为我认为这就是为什么它放慢速度,因为imagepicker应该与iPad的popover一起出现。图像拾取酥料饼

回答:

调整大小设置这样说:

[popoverController setPopoverContentSize:CGSizeMake(1024, 500)]; 

然后在andSuccessBlock和你使用的其他部分:

[self dismissModalViewControllerAnimated:YES]; 

应该

[popoverController dismissPopoverAnimated:YES]; 

这就是为什么ViewController被解雇或从视图中删除,因为它被错误地解雇了办法。

回答:

你在实现AGImagePickerController委托吗?

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

在那里你可以关闭你的UIPopoverController

以上是 图像拾取酥料饼 的全部内容, 来源链接: utcz.com/qa/258887.html

回到顶部