HTML 5 iOS和Android的文件输入[Cordova / Phonegap] [英] HTML 5 File input with iOS and Android [Cordova/Phonegap]
本文介绍了HTML 5 iOS和Android的文件输入[Cordova / Phonegap]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在PhoneGap应用中,我尝试使用HTML5 输入标签。
In a PhoneGap app I tried to use camera using HTML5 input
tag like this.
- 使用CLI创建新项目
- 添加iOS和Android平台
- 添加相机插件
- 在这两个设备上运行
- (实际设备IPhone 5,iOS 7.1.2和Android 4.4.2(Samsung Note))
- create new project using CLI
- Add iOS and Android platform
- Add camera plugin
- build for both devices
- 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 / 。
有一个表格说明哪些操作系统浏览器支持文件输入类型,哪些不支持。 - 输入类型=文件 cordova应用程式中的替代方式
- 如何在phonegap中使用输入类型文件?
- 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屋!
查看全文