简单解决安卓浏览器中上传不能调用相机的问题

      发布在:前端技术      评论:0 条评论
<p><span style="font-family: Verdana, &quot;Lucida Grande&quot;, Arial, Helvetica, sans-serif; font-size: 12px; background-color: rgb(255, 255, 255);">使用input type=file标签进行文件上传时,在安卓手机中的浏览器中不能调起相机,但是在苹果手机中的浏览器中可以调用相机。解决办法就是新增<span class="webkit-html-attribute-name" style="min-width: 0px; min-height: 0px; box-sizing: border-box; color: rgb(34, 34, 34); unicode-bidi: -webkit-isolate; font-family: Consolas, &quot;Lucida Console&quot;, &quot;Courier New&quot;, monospace; font-size: 12px; white-space: pre-wrap;">accept</span><span style="color: rgb(34, 34, 34); font-family: Consolas, &quot;Lucida Console&quot;, &quot;Courier New&quot;, monospace; font-size: 12px; white-space: pre-wrap; background-color: rgb(255, 255, 255);">=&quot;</span><span class="webkit-html-attribute-value" style="min-width: 0px; min-height: 0px; box-sizing: border-box; color: rgb(34, 34, 34); unicode-bidi: -webkit-isolate; font-family: Consolas, &quot;Lucida Console&quot;, &quot;Courier New&quot;, monospace; font-size: 12px; white-space: pre-wrap;">image/*</span><span style="color: rgb(34, 34, 34); font-family: Consolas, &quot;Lucida Console&quot;, &quot;Courier New&quot;, monospace; font-size: 12px; white-space: pre-wrap; background-color: rgb(255, 255, 255);">&quot; 属性即可,网络上有人说通过添加<strong style="font-family: Verdana, &quot;Lucida Grande&quot;, Arial, Helvetica, sans-serif; font-size: 12px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-family: Monaco;">capture=<span style="line-height: 15px;">“camera<span style="line-height: 15px;">”属性那只能调用相机无法选择相册了。</span></span></span></strong></span></span></p>
相关文章
热门推荐