imagePickerController 不会返回相机照片。将返回专辑照片
我正在从我的库加载照片,但来自相机的照片不会显示在 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];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否打开了allowsEditing 属性?如果没有,它不会返回编辑后的图像。您可能会想要:
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:
我知道这是很多个月后的事了,但我为同样的问题而苦苦挣扎,发现虽然这里被问了很多次,但从未得到答复。好吧,我很高兴地说我已经弄清楚了,因此我将其发布在搜索中首先出现的一些几乎相同的问题上。
我在这里发布了完整的答案:
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