1
在我的应用程序中,使用uiimagepicker挑选图像后,它将通过web服务进行处理。 Web处理需要一秒钟,所以我想用活动指示器视图创建一个灰色叠加层。UIImagePicker和覆盖图
我的问题是,UIImagePickerView视图似乎停留在一切,直到处理完成。
我已经尝试使用[myPicker dismissModalViewControllerAnimated:YES];
之前加载覆盖或处理甚至开始,但视图仍然在屏幕上。在此之后,由于随后
ovController = [[OverlayViewController alloc] initWithNibName:@"OverlayViewController" bundle:[NSBundle mainBundle]];
CGFloat yaxis = self.navigationController.navigationBar.frame.size.height;
CGFloat width = self.view.frame.size.width;
CGFloat height = self.view.frame.size.height;
CGRect frame = CGRectMake(0, yaxis, width, height);
ovController.view.frame = frame;
ovController.view.backgroundColor = [UIColor grayColor];
ovController.view.alpha = 0.7;
[self.view insertSubview:ovController.view aboveSubview:self.view];
我一直在使用之前[[myPicker cameraOverlayView] insertSubview:ovController.view];
我解雇myPicker也试过我的叠加加载,但无济于事。
要清楚,我试图在UIImagePicker消失后,但在Web处理启动之前,在屏幕上显示“加载”覆盖图。
任何输入将不胜感激。谢谢
同意,方法完成后更新视图,因此首先关闭选取器,然后添加您的视图,然后在后台调用另一种方法。我通常只做[self performSelector:@selector(processImage :) withObject:picker.image afterDelay:0.05],然后视图事情完成,图像处理在另一个运行循环中进行。使用后台线程应该类似,你只需要照顾autorelease池。 – 2013-02-17 14:47:58