[英]how do I implement “Choose Existing Photo” in my app like in default iphone phonebook?
I want to develop an app which has functionality same as iphone phonebook capturing image and choosing iamge, 我想开发一个应用程序,其功能与iphone电话簿捕获图像和选择iamge相同,
what should I to use for doing such 我该怎么做才能做到这一点
I have made an UIImageView and a button for UIActionSheet, 我为UIActionSheet制作了一个UIImageView和一个按钮,
now I want to perform "Take Photo" and "Choose Existing Photo" options in my app 现在我想在我的应用程序中执行“拍照”和“选择现有照片”选项
help me out, I do appreciate 帮助我,我很感激
thanks in advance .... 提前致谢 ....
Hey @Veer you need to use UIImagePickerController 嘿@Veer你需要使用UIImagePickerController
check out the documentation http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html and check out this link 查看文档http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html并查看此链接
http://iphone.zcentric.com/2008/08/28/using-a-uiimagepickercontroller/ http://iphone.zcentric.com/2008/08/28/using-a-uiimagepickercontroller/
It has sample examples about the same. 它有相同的示例。
Edit you can use these methods to get the image in you UIImageView object 编辑您可以使用这些方法获取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];
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.