Android(安卓)网络图片加载之cude 框架
16lz
2021-01-25
偶然发现了这个框架,阿里图片加载用的这个框架。非常简单操作步骤。
1.首先下载软件包,直接搜Cube ImageLoader 这个。
2.加入jar文件
3.使用前的配置:
public class CubeApplication extends Application { @Override public void onCreate() { super.onCreate(); // other code // .. Cube.onCreate(this); } @Override public void onTerminate() { super.onTerminate(); // other code // ... Cube.onTerminate(); }}
1.首先,创建一个ImageLoader:
Context context;ImageLoader imageLoader = ImageLoaderFatory.create(context);
2.用findViewById()找到要加载图片的ImageView:
CubeImageView imageView = (CubeImageView) view.findViewById(R.id.iv_item_image_list_big);
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <!-- 用定制的CubeImageView --> <in.srain.cube.image.CubeImageView android:id="@+id/iv_item_image_list_big" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitCenter" /></LinearLayout>
3.加载图片。就一句代码:
imageView.loadImage(imageLoader, url);
更多相关文章
- Android, App常用图标尺寸规范
- Android扫描zxing定制化界面实现扫描和图片解析定制ui
- Android游戏框架
- Android扩展 - 拍照篇(Camera)
- 【PullToRefresh 系列一基本使用方法】 Android上拉加载下拉刷新
- android 自定义信息提示框
- Android设置图片圆角的方法
- Android(安卓)背景图片重复平铺 Background repeat
- Eclipse下加载AndroidSDK源码