开发者社区> 问答> 正文

ionic 中使用 cordova camera 插件选择本地图片显示问题

OS 环境是安卓5.1.1,ionic版本是1.1,cordova版本是5.4.1
使用ngCordova中的camera插件选取本地照片并显示在页面中,图片选择没有问题,用chrome调试的时候dom中已经存在img元素并且src是选中的图片,图片资源也加载完成了,但是界面中就是不显示img的图像,整个界面就像是block住了。以下是部分代码:

HTML

<img ng-repeat="image in imageList" ng-src="{{image}}"
                 width="100" height="100"
                style="padding: 5px;">

JS

var options = {
                destinationType: Camera.DestinationType.FILE_URI,
                sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
                saveToPhotoAlbum: true,
                targetWidth: 800,
                targetHeight: 800
            };
            navigator.camera.getPicture(function (imageURI) {
                $timeout(function () {
                    $scope.imageList.push(imageURI);
                });
            }, function (error) {
                //error handle
                console.log("Error: " + error);
            }, options);

展开
收起
杨冬芳 2016-06-20 15:58:21 2995 0
1 条回答
写回答
取消 提交回答
  • IT从业

    更新到ionic 1.2 之后问题解决了

    2019-07-17 19:44:15
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Protecting Visual Assets 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载