我在基于ipad的application.so中使用uiimage选择器控件,我使用以下代码显示它:
[self presentModalViewController:myImagePicker animated:YES];但是有一个错误显示
'On iPad, UIImagePickerController must be presented via UIPopoverController'如何添加一个UIImagePickerController控制器到我的基于ipad的应用程序来显示多个images.can谁给我一个很好的方法。
发布于 2011-06-09 19:26:14
就像你在this.When操作按钮中点击一个按钮一样,调用this。
UIActionSheet *photoActionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Take Photo", @"Choose Existing",nil];
[photoActionSheet showFromRect:CGRectMake(315, 355, 10, 10) inView:self.view animated:YES];发布于 2011-06-09 20:27:12
#pragma mark UIActionSheetDelegate methods
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
imgPicker.delegate = self;
if(buttonIndex == 0){
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:imgPicker animated:YES];
}
else if(buttonIndex == 1){
imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:imgPicker animated:YES];
}
}https://stackoverflow.com/questions/6291885
复制相似问题