我有一个像这样的UIImagePickerController:
// Start picker code
UIImagePickerController *photo = [[UIImagePickerController alloc] init];
photo.delegate = self;
photo.allowsEditing = NO;
//photo.showsCameraControls = NO;
photo.sourceType = UIImagePickerControllerSourceTypeCamera;
cameraView.frame = photo.cameraOverlayView.frame;
photo.cameraOverlayView = cameraView;
// photo.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
//[photo setCameraOverlayView:cameraView];
[self presentViewController:photo animated:YES completion:nil];
我在文档中看到 - (void)takePicture,但是如何在单击图片时运行代码?
答案 0 :(得分:0)
通过将self
注册为UIImagePickerController
的代表,您可以覆盖- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
。