是否可以从我的应用程序启动(将用户重定向到)iphone 的本机照片库应用程序,类似于电子邮件?这现在可以在 4.2 sdk 中实现吗?
问问题
6566 次
1 回答
6
为此,您必须创建并呈现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
字典中的图像。
于 2010-11-25T09:31:05.640 回答