zoukankan      html  css  js  c++  java
  • (Android图片内存优化)Picasso加载图片 教程。。详细版

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

    Debug ribbon indicators


    示例代码:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    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(5050)
      .centerCrop()
      .into(imageView)
    程序员小冰博客:http://blog.csdn.net/qq_21376985 技术交流QQ986945193 微博:http://weibo.com/mcxiaobing
  • 相关阅读:
    符号表
    经典算法-堆排序
    AngularJs基础
    Echars详解
    经典算法-快速排序
    经典算法-递归
    异常分类,异常抛出位置
    js的数据类型具体分析
    函数
    数据
  • 原文地址:https://www.cnblogs.com/mcxiaobing/p/5472118.html
Copyright © 2011-2022 走看看