2010-11-25 164 views
3

是否可以从我的应用程序启动(将用户重定向到)本机照片库应用程序,类似于电子邮件?这是现在可能在4.2 SDK?从iphone应用程序启动照片库应用程序

+0

我不知道它是哪个示例,但是您可以在自己的应用程序中显示照片应用程序中的照片。检查苹果示例代码。 – 2010-11-25 09:23:36

+0

您是否找到解决方案? – philipp 2012-02-13 21:43:04

回答

6

对于这一点,你必须创建和呈现UIImagePickerController这样的:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; 
imagePicker.delegate = self; 
imagePicker.allowsEditing = YES; 
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 
[self presentModalViewController:imagePicker animated:YES]; 

您可以更改imagePicker.sourceTypeimagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;如果你希望用户使用相机来代替。

委托方法:- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info会给你在info字典中的图像。

相关问题