0
我有一個選項卡欄應用程序,其中一個選項卡使用導航控制器來移動一系列視圖。在最後一個視圖中,有一個按鈕用於添加一張照片,該照片呈現一個UIImagePickerController。到目前爲止,這麼好 - 但是當我完成選取圖像或取消操作時,先前的視圖已加載,但沒有標籤欄。我敢肯定,我錯過了一些基本的東西,但是如何正確發佈UIImagePickerController的任何建議都將不勝感激。代碼如下:從UITabBarController中解除UIImagePickerController
ImagePickerViewController *aController = [[ImagePickerViewController alloc]; initWithNibName:@"ImagePickerViewController" bundle:[NSBundle mainBundle]];
[self presentModalViewController:aController animated:YES];
[aController release];
//viewDidLoad
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
if([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]){
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
} else {
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
}
[window addSubview:imagePickerController.view];
//ImagePickerViewController imagePickerControllerDidCancel - FinalViewController is the last view in the stack controlled by a navigation controller which contains the button to present the UIImagePickerController
[picker dismissModalViewControllerAnimated:YES];
FinalViewController *aController = [[FinalViewController alloc initWithNibName:@"FinalViewController" bundle:[NSBundle mainBundle]];
[picker presentModalViewController:aController animated:YES];
[aController release];
這是一個巨大的幫助,無論是對眼前的問題,還是對我的理解模態視圖控制器。非常感謝。 – Dave 2010-05-21 19:28:56
那麼,如果答案有幫助,那麼你可能會考慮投票,可能會接受它的確定性;-) – 2010-05-24 13:35:56