2

我在相机 OverlayView.xib 上有一个 UIActivityIndi​​catorView 中间。我通过反复调用[cameraPicker takePicture]来拍摄多个快照。我想在以下代码完成所有快照时显示指示器:

- (void)didTakePicture:(UIImage *)picture {   //Called from picker didFinishPickingMediaWithInfo

   [self.capturedImages addObject:picture];
   snapsCount ++;
   if (snapsCount < noOfSnaps) {
      [cameraPicker takePicture];
   }else {
     overlayView.indicator.hidden = NO;  //Not showing indicator
     [overlayView.indicator startAnimating]; //Not working
   }
}

谁能告诉我不显示的原因。通过以下条件,我可以在拍摄最后一张快照之前显示指标,但为什么最后不能。

if (snapsCount < noOfSnaps) {
    if (snapsCount+1 == noOfSnaps) {

       overlayView.indicator.hidden = NO;  //Show the indicator
       [overlayView.indicator startAnimating];   //Work nicely
       overlayView.userMessage.text = @"Processing";
    }
    [cameraPicker takePicture];
}

有没有人遇到过这个问题并且知道在所有快照完成后显示指标的解决方案。

提前致谢。

4

1 回答 1

0
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{

if (snapsCount > noOfSnaps) {
overlayView.indicator.hidden = NO;  
[overlayView.indicator startAnimating];
}
[NSTimer scheduledTimerWithTimeInterval:0.3
                                 target:self 
                               selector:@selector(didTakePicture:) 
                               userInfo: [info objectForKey:UIImagePickerControllerOriginalImage] 
                                repeats:NO];
}
于 2012-05-23T05:33:01.753 回答