Display images from Gallery in iPhone(在 iPhone 中显示图库中的图像)
问题描述
我是 iPhone 的新手,现在正处于学习阶段.实际上,我想实现读取存储在 iPhone PHOTO Gallery 中的图像,然后将其显示到我的应用程序中.
I am new in iPhone and in learning phase now a days. Actually i want to implement that i read images stored in my iPhone PHOTO Gallery and then display it onto my application.
我在许多搜索引擎中搜索过,但找不到任何东西.你们都是这里的专业人士.请通过一些代码或教程指导我.
I have searched in many Search Engines but could not find any thing. You all are professionals over here. Please guide me thrrough some code or some tutorial.
非常感谢
推荐答案
编辑
还请查看此问题/答案以及用于从 uiimagepickercontroller
获取图像的方法,因为我之前提到的方法已被弃用.
Also check out this question/answer and the method that is used to get the image from uiimagepickercontroller
as the method that i have mentioned earlier is deprecated.
didFinishPickingMediaWithInfo 返回零照片
查看文档 http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html并查看此链接
check out the documentation http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html and check out this link
http://iphone.zcentric.com/2008/08/28/using-a-uiimagepickercontroller/
它有大致相同的示例.
您可以使用这些方法在您的 UIImageView 对象中获取图像
You can use these methods to get the image in you UIImageView object
- (void)selectPhotos
{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
[self presentViewController:picker animated:YES completion:nil];
//Deprecated In IOS6[self presentModalViewController:picker animated:YES];
[picker release];
}
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingImage:(UIImage *)image
editingInfo:(NSDictionary *)editingInfo
{
imageView.image = image;
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}
这篇关于在 iPhone 中显示图库中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 iPhone 中显示图库中的图像
基础教程推荐
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01