我创建并展示了一个 UIDocumentInteractionController ,其中包含一个保存图像的有效 url,但是当我展示 Controller 时,“保存图像”没有出现。
NSURL *url = ...;
self.interactionController = [UIDocumentInteractionController interactionControllerWithURL:url];
[self.interactionController presentOptionsMenuFromBarButtonItem:sender animated:YES];
我已验证 self.interactionController.UTI 是有效的图像类型 (jpeg)
______实际_______与____预期_____
____
注意*如果有人知道格式化这些图像的更好方法,请成为我的客人
Best Answer-推荐答案 strong>
为了有保存到相机胶卷的选项,应用必须有权访问照片。
相对于 ALAuthorizationStatus ([ALAssetsLibrary authorizationStatus] )
“保存图像”显示为
ALAuthorizationStatusAuthorized
ALAuthorizationStatusNotDetermined
“保存图片”不显示
ALAuthorizationStatusRestricted
ALAuthorizationStatusDenied
你可以这样检查:
#import <AssetsLibrary/AssetsLibrary.h>
- (BOOL)canSaveToCameraRoll
{
ALAuthorizationStatus status = [ALAssetsLibrary authorizationStatus];
return (status == ALAuthorizationStatusAuthorized || status == ALAuthorizationStatusNotDetermined);
}
关于ios - UIDocumentInteractionController 工作但不显示 "Save Image",我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/30631340/
|