Android Picasso图片下载和缓存库

联合创作 · 2023-09-29 09:19

Picasso 是 Android 上一个强大的图片下载和缓存库。

 

示例代码:

Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);

@Override public void getView(int position, View convertView, ViewGroup parent) {
  SquaredImageView view = (SquaredImageView) convertView;
  if (view == null) {
    view = new SquaredImageView(context);
  }
  String url = getItem(position);

  Picasso.with(context).load(url).into(view);
}

//图像处理
Picasso.with(context)
  .load(url)
  .resize(50, 50)
  .centerCrop()
  .into(imageView)
浏览 1
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报