ios - UIDocumentInteractionController 工作但不显示 "Save Image"
<p><p>我创建并展示了一个 <code>UIDocumentInteractionController</code>,其中包含一个保存图像的有效 url,但是当我展示 Controller 时,“保存图像”没有出现。 </p>
<pre><code>NSURL *url = ...;
self.interactionController = ;
;
</code></pre>
<p>我已验证 <code>self.interactionController.UTI</code> 是有效的图像类型 (jpeg) </p>
<h2>______实际_______与____预期_____</h2>
<p> <a href="/image/jkc7k.png" rel="noreferrer noopener nofollow"><img src="/image/jkc7km.png" alt="Actual image"/></a> ____ <a href="/image/C4hJj.png" rel="noreferrer noopener nofollow"><img src="/image/C4hJjm.png" alt="Expected image"/></a> </p>
<p>注意*如果有人知道格式化这些图像的更好方法,请成为我的客人</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>为了有保存到相机胶卷的选项,应用必须有权访问照片。</p>
<p>相对于 <code>ALAuthorizationStatus</code> (<a href="https://developer.apple.com/library/ios/documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/#//apple_ref/c/tdef/ALAuthorizationStatus" rel="noreferrer noopener nofollow"><code></code></a>)</p>
<p>“保存图像”显示为</p>
<ol>
<li><code>ALAuthorizationStatusAuthorized</code></li>
<li><code>ALAuthorizationStatusNotDetermined</code></li>
</ol>
<p>“保存图片”不显示</p>
<ol>
<li><code>ALAuthorizationStatusRestricted</code></li>
<li><code>ALAuthorizationStatusDenied</code></li>
</ol>
<p>你可以这样检查:</p>
<pre><code>#import <AssetsLibrary/AssetsLibrary.h>
- (BOOL)canSaveToCameraRoll
{
ALAuthorizationStatus status = ;
return (status == ALAuthorizationStatusAuthorized || status == ALAuthorizationStatusNotDetermined);
}
</code></pre></p>
<p style="font-size: 20px;">关于ios - UIDocumentInteractionController 工作但不显示"Save Image",我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/30631340/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/30631340/
</a>
</p>
页:
[1]