3 つの画面を持つアプリケーションを使用しています。
まずはホーム画面です。ボタンのあるホーム画面から、ユーザーは 2 番目の画面に移動します。ここには、写真を撮るためのボタンのみを備えたカメラ オーバーレイがあります。
ユーザーが写真を撮るとき、最後の画面に移動するボタンを押すことができます。しかし、彼が最後の画面からホームに移動し、次にオーバーレイの 2 番目の画面に移動すると、カメラは閉じられます。ボタンは彼が写真を撮ることができるように見えますが、彼はカメラを通して見ることができません.
ホーム画面に次のコードを使用して、オーバーレイを開始します。
if (self.imageView.isAnimating)
self.imageView.stopAnimating;
if ([UIImagePickerController isSourceTypeAvailable:sourceType])
{
[self.overlayViewController setupImagePicker:sourceType];
[self presentModalViewController:self.overlayViewController.imagePickerController animated:YES];
}
overlayviewcontroller
2 番目の画面とoverlayviewcontroller
次のコードの場所は次のとおりです。
- (void)setupImagePicker:(UIImagePickerControllerSourceType)sourceType
{
self.imagePickerController.sourceType = sourceType;
if (sourceType == UIImagePickerControllerSourceTypeCamera)
{
self.imagePickerController.showsCameraControls = NO;
if ([[self.imagePickerController.cameraOverlayView subviews] count] == 0)
{
CGRect overlayViewFrame = self.imagePickerController.cameraOverlayView.frame;
CGRect newFrame = CGRectMake(0.0,
CGRectGetHeight(overlayViewFrame) - self.view.frame.size.height - 10.0,
CGRectGetWidth(overlayViewFrame),
self.view.frame.size.height + 10.0);
self.view.frame = newFrame;
[self.imagePickerController.cameraOverlayView addSubview:self.view];
}
}
}
助けていただければ幸いです。