iOS应用上的HTML输入文件,禁用“拍照”选项 [英] HTML input file on iOS app, disable "take photo" option

查看:273
本文介绍了iOS应用上的HTML输入文件,禁用“拍照”选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在iOS应用程序(基于WKWebView)中禁用拍照选项,并强制用户从库或iCloud中选择照片。

I want to disable the "Take Photo" option in an iOS app (WKWebView based) and force users to select photos from library or iCloud.

我可以通过 capture 布尔属性强制用户使用相机:

I can force users to use the camera by the capture boolean attribute:

<input type="file" accept="image/*" multiple capture>

但是,我找不到任何类似的东西完全相反(禁用相机)。是否可以使用任何其他HMTL属性或捕获的不同值?

But, I can't found anything similar to do exactly the opposite (disable camera). Is that possible with any other HMTL attribute or a different value for capture?

此处提出类似问题:< a href =https://stackoverflow.com/questions/16819845/how-to-disable-take-photo-on-file-input-ios-6>如何在文件输入iOS 6上禁用拍照,但建议的解决方案:

Similar question was asked here: How to disable take photo on file input iOS 6, but the proposed solution:


我们还可以使用HTML5新布尔属性请求多个文件。在这种情况下,用户无法使用相机作为来源。

We can also request multiple files using the HTML5 new boolean attribute. In this case, the user can’t use the camera as a source.

对我不起作用(我试过iOS) 9 +)。

doesn't work for me (I tried with iOS 9+).

推荐答案

使用IOS无法做到这一点。最好的解决方案是阻止照片刚拍摄。您可以查看照片的日期,如果它是在最后一分钟内您知道它刚被拍摄而未上传。由于用户必须上传照片然后将其封锁,这有点不方便。无法禁用相机。

There is no way to do this with IOS. The best solution would be to block the photo if it was just taken. You can check the date of the photo and if it was within the last minute you know it was just taken and not uploaded. It is a bit inconvenient due to the fact that users have to upload the photo then have it blocked. There is no way to disable the camera.

这篇关于iOS应用上的HTML输入文件,禁用“拍照”选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆