ELCimagepicker(https://github.com/Fingertips/ELCImagePickerController)をプロジェクトに追加しましたが、これは完全に機能し、ユーザーはスライドショー用に複数の画像を選択できます。ただし、[保存]をクリックすると、追加された写真の数によっては、長い遅延が発生する可能性があります。
ユーザーが[保存]をクリックしたときにUIActivityIndicatorを追加しようとしましたが、表示されるモーダルビューが原因で問題が発生しました。ELCimagepickerが提示するアクティビティ(ELCImagePickerController)からメソッドを呼び出すことができます。これは、イメージピッカーの提示を処理するアクティビティによってアクションが実行されます。ただし、ビューに追加しようとすると、モーダルがアクティビティインジケーターの上にあるため、表示されません。
私はbringSubviewToFrontを使用してみましたが、[[self parentViewController] addSubView]を使用してimagepickerメソッドファイルにコードを直接追加しようとしましたが、うまくいきませんでした。
私が試した最新のコードは次のとおりです:(インジケーターは.hファイルでUIActivityIndicator*インジケーターとして宣言されています)
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...
どんな助けでも素晴らしいでしょう。
ありがとう。