2011-07-14 5 views
0

から戻った後、白い画面を得たが、状況です:UIImagePickerControllerはここのUIViewController

[UIImagePickerController takePicture]; 

次デリゲート関数から写真をとった後

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

が呼び出されます。

内のコードは

NSLog(@"Photo taken"); 
UIImage *newImage = [self resizeImage:[info objectForKey:UIImagePickerControllerOriginalImage]]; 
NSLog(@"Width: %d, Height: %d ",(int)newImage.size.width, (int)newImage.size.height); 
//[imagePickerController dismissModalViewControllerAnimated:YES]; 
ProcessCompleteView *pcv = [[ProcessCompleteView alloc] initWithNibName:@"ProcessCompleteView" bundle:nil]; 
[imagePickerController presentModalViewController:pcv animated:YES]; 
[pcv release]; 

である私がかなった表示するには、別のビューと呼ばれてきたと私は dismissModalViewController を使用して、PCVから戻って戻ったときに、カメラのリアルタイムキャプチャを表示する必要がある領域がホワイトになります。しかし、UIImagePickerControllerを却下してもう一度表示すると、カメラは正常に動作します!

誰でもこの奇妙な問題に私を助けることができますか?

ありがとうございました。

答えて

0

ビューを表示する順序が正しくありません。

正しい順序は次のとおりです。 親コントローラのビューショー - > UIImagePickerControllerのビュー・ショー - > UIImagePickerControllerのビューが隠さ - > ProcessCompleteView

を示したので、親コントローラのviewWillAppearメソッドに

ProcessCompleteView *pcv = [[ProcessCompleteView alloc] initWithNibName:@"ProcessCompleteView" bundle:nil]; 
[imagePickerController presentModalViewController:pcv animated:YES]; 
[pcv release]; 

を削除し、してください電話

ProcessCompleteView *pcv = [[ProcessCompleteView alloc] initWithNibName:@"ProcessCompleteView" bundle:nil]; 
[parentController presentModalViewController:pcv animated:YES]; 
[pcv release]; 
関連する問題