【问题标题】:Making an iOS file input go directly to the camera app?使 iOS 文件输入直接转到相机应用程序?
【发布时间】:2013-05-22 09:36:51
【问题描述】:

背景:在撰写本文时,iOS 6.1 不允许在单个输入中同时选择多个文件和拍照。

由于我的主应用程序已经有一个用于选择文件的多输入选择器,我想添加第二个按钮(仅在 iOS 设备上需要且仅在其上显示)来启动相机。

目前适用于:

<input type="file" class="ios_only" accept="image/*;capture=camera">

然而 iOS Safari 总是给出以下对话框:

有没有办法让&lt;input&gt; 在没有这个提示的情况下直接进入摄像头?

【问题讨论】:

标签: ios file-upload safari camera mobile-safari


【解决方案1】:

不,你不能。 Safari 将其作为UIImagePickerView 处理,并且必须通过此UIActionSheet 选择源。

供您参考,此行具有相同的效果:

<input type="file" class="ios_only" accept="image/*" capture="camera">

也在 iOS 7 中测试。

【讨论】:

    【解决方案2】:

    对于多个文件上传:

    <input capture="camera" accept="image/*" multiple="multiple" type="file" name="photo" id="photo" value="" />
    

    【讨论】:

      猜你喜欢
      • 2019-02-23
      • 1970-01-01
      • 2014-12-10
      • 2011-11-11
      • 1970-01-01
      • 2022-07-13
      • 2011-10-18
      • 2021-03-02
      • 2014-11-11
      相关资源
      最近更新 更多