1
我想從iPad應用程序訪問照片庫。據說「在iPad上,UIImagePickerController必須通過UIPopoverController呈現」。這正是我得到的日誌消息。UIImagePickerController與UIPopOverController,iPad的iOS 6
這裏是我的應用程序的快照:
既然我已經列出通過酥料餅的選項,它沒有任何意義從內部去另一個酥料餅。當用戶點擊「照片庫」單元時,accessPhotoLibrary方法被調用。
-(void)accessPhotoLibrary{
NSLog(@"Photo library access requested!");
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]){
NSLog(@"Photo Library");
[imagePickerController setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[imagePickerController setDelegate:self];
[imagePickerController setModalPresentationStyle:UIModalPresentationFullScreen];
[self presentViewController:imagePickerController animated:YES completion:nil];
}
else{
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle: @"Photo Library"
message: @"Sorry, couldn't open your photos library"
delegate: nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}
}
但是,如何解決這個問題,我必須使用popover訪問照片庫時,我已經使用一個?
任何幫助,非常感謝。
你現在的代碼有什麼問題?看起來它會起作用。 – Undo 2013-04-11 16:48:19
您需要爲圖像選擇器使用另一個「UIPopoverController」(如果是用於照片庫 - 相機應該位於全屏模式視圖控制器中)。不要重複使用該選項的小彈出窗口。順便說一句 - 爲什麼不使用「UIActionSheet」的選項? – rmaddy 2013-04-11 16:48:28
@ErwaySoftware如果圖像選擇器不適用於攝像機,則UIImagePickerController必須位於iPad上的「UIPopoverController」中。 – rmaddy 2013-04-11 16:49:01