我创建并向保存的图像显示带有有效网址的NSURL *url = ...;
self.interactionController = [UIDocumentInteractionController interactionControllerWithURL:url];
[self.interactionController presentOptionsMenuFromBarButtonItem:sender animated:YES];
但是当我出示控制器时#34;保存图像"没有出现。
self.interactionController.UTI
我已验证ALAuthorizationStatus
是有效的图片类型(jpeg)
注意*如果有人知道格式化这些图片的更好方法,请成为我的客人
答案 0 :(得分:2)
为了能够选择保存到相机胶卷,应用必须具有访问照片的权限。
相对于ALAuthorizationStatusAuthorized
([ALAssetsLibrary authorizationStatus]
)
"保存图片"显示为
ALAuthorizationStatusNotDetermined
ALAuthorizationStatusRestricted
"保存图片"
不显示ALAuthorizationStatusDenied
#import <AssetsLibrary/AssetsLibrary.h>
- (BOOL)canSaveToCameraRoll
{
ALAuthorizationStatus status = [ALAssetsLibrary authorizationStatus];
return (status == ALAuthorizationStatusAuthorized || status == ALAuthorizationStatusNotDetermined);
}
您可以这样检查:
# urls.py
patterns = urlpatterns('',
#...
url(r'whatever/(P?<subject>[a-z-]+>)/$', 'myviews.index', ...),
)
# myviews.py
def index(request, subject):
# do whatever
context = {
# whatever else
'subject':subject
}
return render(request, "whatever/index.html", context)
# whatever/index.html
<html>
# headers etc
<body class="something {{ subject }} etc">
# whatever here
</body>
</html>