|
默认在我们phoengap中只能一次选择一张图片,所以很多人都很纠结,下面给大家分享一个 phonegap 多图片选择插件
github地址:
https://github.com/wymsee/cordova-imagePicker
phonegap 3.0以上在线安装地址:
- phonegap plugin add https://github.com/wymsee/cordova-imagePicker.git
- cordova plugin add https://github.com/wymsee/cordova-imagePicker.git
复制代码
使用插件:
The plugin creates the object window.imagePicker with the method getPictures(success, fail, options)
Example - Get Full Size Images (all default options):
- The plugin creates the object window.imagePicker with the method getPictures(success, fail, options)
- Example - Get Full Size Images (all default options):
- window.imagePicker.getPictures(
- function(results) {
- for (var i = 0; i < results.length; i++) {
- console.log('Image URI: ' + results[i]);
- }
- }, function (error) {
- console.log('Error: ' + error);
- }
- );
- Example - Get at most 10 images scaled to width of 800:
- window.imagePicker.getPictures(
- function(results) {
- for (var i = 0; i < results.length; i++) {
- console.log('Image URI: ' + results[i]);
- }
- }, function (error) {
- console.log('Error: ' + error);
- }, {
- maximumImagesCount: 10,
- width: 800
- }
- );
复制代码
本地下载地址:
cordova-imagePicker-master.zip
(95.42 KB, 下载次数: 440)
|
|