【发布时间】:2011-05-15 14:18:11
【问题描述】:
是否可以从我的应用程序启动(将用户重定向到)iphone 的本机照片库应用程序,类似于电子邮件?这现在可以在 4.2 sdk 中实现吗?
【问题讨论】:
-
我不知道是哪个例子,但是您可以在自己的应用程序中显示照片应用程序中的照片。检查苹果示例代码。
-
您找到解决方案了吗?
标签: iphone gallery photo launch
是否可以从我的应用程序启动(将用户重定向到)iphone 的本机照片库应用程序,类似于电子邮件?这现在可以在 4.2 sdk 中实现吗?
【问题讨论】:
标签: iphone gallery photo launch
为此,您必须像这样创建并呈现UIImagePickerController:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:imagePicker animated:YES];
如果您希望用户改用相机,您可以将imagePicker.sourceType 更改为imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;。
委托方法:- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 将为您提供info 字典中的图像。
【讨论】: