我想开发一款应用程序,其功能与iphone电话簿捕获图像和选择iamge相同,
我应该用什么来做这样的
我为UIActionSheet创建了一个UIImageView和一个按钮,
现在我想在我的应用程序中执行“拍照”和“选择现有照片”选项
帮助我,我很感激
提前感谢....
答案 0 :(得分:10)
嘿@Veer你需要使用UIImagePickerController
http://iphone.zcentric.com/2008/08/28/using-a-uiimagepickercontroller/
它有相同的示例。
编辑您可以使用这些方法获取UIImageView对象中的图像
- (void)selectPhotos
{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
[self presentModalViewController:picker animated:YES];
[picker release];
}
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingImage:(UIImage *)image
editingInfo:(NSDictionary *)editingInfo
{
imageView.image = image;
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}