随缘56 2019-12-06 15:25 采纳率: 0%
浏览 576
已结题

android 中使用Picasso加载图片无效,该怎么解决?

Android 中在Fragment控件中ListView中添加图片,加载不出来


 public View getView(int position, View view, ViewGroup parent) {
            if (view==null) {
                view = LayoutInflater.from(getContext()).inflate(resource, parent, false);
            }
            News news=getItem(position);
            ImageView imageView=view.findViewById(R.id.lv_image);
            TextView name=view.findViewById(R.id.lv_title);
            TextView from=view.findViewById(R.id.lv_from);
            TextView time=view.findViewById(R.id.lv_time);
            TextView read_num=view.findViewById(R.id.lv_read_num);
            String s="http:"+news.getPic();
            Log.v("ssss",s);
            Picasso.with(view.getContext()).load(s).into(imageView);
            name.setText(news.getName());
            from.setText(news.getFrom());
            time.setText(news.getTime());
            read_num.setText(news.getRead_num());
            return view;

    }
  • 写回答

5条回答 默认 最新

  • qq_28774507 2019-12-06 15:50
    关注

    你可以选择使用glide,试试

    评论

报告相同问题?

悬赏问题

  • ¥50 易语言把MYSQL数据库中的数据添加至组合框
  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况