捕获的图像未显示在uiimageView中

时间:2010-10-26 10:29:19

标签: iphone objective-c uiimageview camera uiimagepickercontroller

我有一个uibutton触发iphone相机抓取图像,我在同一视图中有一个uiimageView来显示捕获的图像,但是在捕获后它没有显示任何内容。

任何解决方案?

1 个答案:

答案 0 :(得分:0)

这是我的代码:

  • (IBAction为)grabImage:(ID)发送方{
  

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsImageEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController: picker animated:YES];
[picker release];

}

- (void)imagePickerController:(UIImagePickerController *)选取器       didFinishPickingImage :( UIImage *)图片                  editingInfo:(NSDictionary *)editingInfo {     cameraImageView.image = image;     [picker dismissModalViewControllerAnimated:YES];

}