私はUIActionSheet
を持っています。カメラまたは写真ライブラリから画像を選択するオプションがあります。このために私はimagePickerViewControllerを取った。カメラのためにそれは絶対にうまく動作します。しかし、写真ライブラリではありません。小さなpopupViewControllerフォトライブラリオプションに触れるにはIPadのUIActionSheetからuiimagepickercontrollersourcetypephotolibraryのためのUIImagePickerViewControllerを表示
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0)
{
imgController = [[UIImagePickerController alloc] init];
imgController.allowsEditing = YES;
imgController.sourceType = UIImagePickerControllerSourceTypeCamera;
imgController.delegate=self;
[self presentModalViewController:imgController animated:YES];
}
else if (buttonIndex == 1)
{
if ([self.popoverController isPopoverVisible]) {
[self.popoverController dismissPopoverAnimated:YES];
[popoverController release];
} else {
if ([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypeSavedPhotosAlbum])
{
UIImagePickerController *imagePicker =
[[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType =
UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.allowsEditing = NO;
self.popoverController = [[UIPopoverController alloc]
initWithContentViewController:imagePicker];
self.popoverController.delegate = self;
[self.popoverController setPopoverContentSize:CGSizeMake(500, 500)];
[self.popoverController presentPopoverFromRect:self.view.frame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
[imagePicker release];
}
}
}
}
は、ビューの上に作成されたが、それは非常に小さいです。 popupViewControllerが小さすぎるのはなぜですか? uiimagepickercontrollersourcetypephotolibrary
にUIImagePickerViewController
を表示するための他の方法はありますか?
あなたが望む通りにpresentPopoverFromRectのサイズを変更します。 – Hiren