我已将 ELCimagepicker (https://github.com/Fingertips/ELCImagePickerController) 添加到我的项目中,它运行良好,允许用户为幻灯片选择多个图像。但是,当您单击“保存”时,可能会有很长的延迟,具体取决于添加的照片数量。
当用户单击“保存”时,我一直在尝试添加 UIActivityIndicator,但由于呈现的模式视图而遇到问题。我可以从 ELCimagepicker 呈现的活动 (ELCImagePickerController) 中调用一个方法,这将由处理图像选取器呈现的活动执行。但是每当我尝试添加到视图时,它都不会显示,因为模式位于活动指示器的顶部。
我尝试过使用bringSubviewToFront,我尝试使用[[self parentViewController] addSubView] 将代码直接添加到imagepicker 方法文件中,但没有运气。
这是我尝试过的最新代码:(指标在 .h 文件中声明为 UIActivityIndicator *indicator)
indicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
indicator.hidden=false;
[self.navigationController.view addSubview:self.indicator];
[self.navigationController.view bringSubviewToFront:self.indicator];
[indicator startAnimating];
if([delegate respondsToSelector:@selector(elcImagePickerController:showIndicator:)]) {
[delegate performSelector:@selector(elcImagePickerController:showIndicator:) withObject:self withObject:@"test"];
}
有没有人在 ELCimagepicker 之上添加 UIActivityIndicator 或由另一个类处理的另一个模态视图取得任何成功?
我已经尝试过 MBProgressHUD,但也无法正常工作 - 当我在 ELCimagepicker 类中使用它时它会显示出来,但在删除时崩溃:
bool _WebTryThreadLock(bool), 0x42368e0: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...
任何帮助都会很棒。
谢谢。