HTML 5 iOS和Android的文件输入[Cordova / Phonegap] [英] HTML 5 File input with iOS and Android [Cordova/Phonegap]

查看:218
本文介绍了HTML 5 iOS和Android的文件输入[Cordova / Phonegap]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在PhoneGap应用中,我尝试使用HTML5 输入标签。

In a PhoneGap app I tried to use camera using HTML5 input tag like this.


  1. 使用CLI创建新项目

  2. 添加iOS和Android平台

  3. 添加相机插件

  4. 在这两个设备上运行

  5. (实际设备IPhone 5,iOS 7.1.2和Android 4.4.2(Samsung Note))

  1. create new project using CLI
  2. Add iOS and Android platform
  3. Add camera plugin
  4. build for both devices
  5. run on both devices (Actual device IPhone 5 with iOS 7.1.2 and Android 4.4.2 (Samsung Note))

以下是我尝试执行的代码行

Following is the code line that I tried to execute

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

它适用于iPhone,但不适用于Android。我错过了什么?或者这不是在Android中支持?
在Android中敲击字段后,在iPhone中它不会发生任何事情,它的行为如下

It works in iPhone but not in Android. What have I missed? Or is this not supported in Android? After tapping on the field in Android nothing happens while in iPhone it acts like below

推荐答案

以下是几个链接:

  • http://viljamis.com/blog/2012/file-upload-support-on-mobile/. There is a table which says which all OS browsers are supporting file input type and which are not.
  • input type="file" alternative in cordova app
  • How to use input type file in phonegap?

希望这有助于

这篇关于HTML 5 iOS和Android的文件输入[Cordova / Phonegap]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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