だから私はどこにUIPopoverController何を収容しているのかを持っていますが、私のオプションの1つは、UINavigationControllerそこに行って画像を選択することです...今ではiPhoneで簡単に使用できますが、UIPopoverController内からそれを呼び出すとクラッシュするため、ありえない...UITableViewControllerUITableViewUIImagePickerControllerpresentModalViewController:animated:
UIImagePickerController私はそれ自体のニーズも知っているUINavigationControllerので、どちらかをプッシュすることはできませんpushViewController:animated:...
だから私が作成したへのリンクを保持していれば、UIImagePickerControllerのviewControllerに切り替えるためにUIPopoverController使用できることがわかりました...setContentViewController:animated:
UINavigationControllerただし、キャンセルボタンを追加できるようにする必要があるため、以前に戻る方法をユーザーに提供することに行き詰まっていますUIImagePickerControllerが、これを実行しようとするとキャンセルボタンが追加されません...
私が使用している私のコードはこちら
-(void)doPhotoalbums {
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
[imagePicker setDelegate:self];
[imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[imagePicker setContentSizeForViewInPopover:CGSizeMake(320, 480)];
UIBarButtonItem *cancel = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:nil];
[imagePicker.navigationItem setLeftBarButtonItem:cancel];
//[self presentModalViewController:imagePicker animated:YES];
[[self parentPopoverController] setContentViewController:imagePicker animated:YES];
} else {
[UIAlertView showMessage:@"This device does not have any photo albums."];
}
}
だから私の質問は..これを回避する方法を知っている人はいますか? キャンセル/戻るボタンを追加して、navigationControllers を元に戻すか、これを表示する別の方法を追加します (2 つの UIPopoverControllers 間の切り替えを避けたいのですが、他に何ができるかわかりません..
ありがとう
リアム