imagePickerController 不会返回相机照片。将返回专辑照片

发布于 2024-08-29 02:45:26 字数 454 浏览 2 评论 0 原文

我正在从我的库加载照片,但来自相机的照片不会显示在 imageView 中。我设置了allowsImageEditing = YES。我也使用过 CFShow(info) 并且来自相机的数据不为零......

 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{   
    UIImage *image = [info objectForKey:@"UIImagePickerControllerEditedImage"];

    [self.imageView setImage:image];
    [self dismissModalViewControllerAnimated:YES];
    [picker release];   
}

i'm loading photos from my library just fine, but photos coming from he camera don't display in the imageView. I've set allowsImageEditing = YES. I've also used CFShow(info) and the data from the camera is not nil...

 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{   
    UIImage *image = [info objectForKey:@"UIImagePickerControllerEditedImage"];

    [self.imageView setImage:image];
    [self dismissModalViewControllerAnimated:YES];
    [picker release];   
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雨的味道风的声音 2024-09-05 02:45:26

您是否打开了allowsEditing 属性?如果没有,它不会返回编辑后的图像。您可能会想要:

UIImagePickerControllerOriginalImage

Did you turn on the allowsEditing property of the UIImagePicker? If not, it's not going to return you an editedImage. You'll probably want:

UIImagePickerControllerOriginalImage

请你别敷衍 2024-09-05 02:45:26

我知道这是很多个月后的事了,但我为同样的问题而苦苦挣扎,发现虽然这里被问了很多次,但从未得到答复。好吧,我很高兴地说我已经弄清楚了,因此我将其发布在搜索中首先出现的一些几乎相同的问题上。

我在这里发布了完整的答案:
didFinishPickingMediaWithInfo 返回零照片

I know this is many months later, but I struggled with the same problem and found that though it was asked here many times, it was never answered. Well, I'm happy to say that I figured it out and so am posting it on a few of the nearly-identical questions that come up first on a search.

I posted the full answer here:
didFinishPickingMediaWithInfo return nil photo

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文