ImageLoader加载本地图片

public class Constants {
    /**
     * 从网络加载图片
     * 
 "http://pic28.nipic.com/20130420/10753400_140144592172_2.jpg"; 
     * from http
     */
    static String[] httpImages = {
            "http://"
    };
    /**
     * 从内存卡中异步加载本地图片
     * String imageUri = "file:///mnt/sdcard/image.png"; // from SD card
     */
    static String[] SDCardImages = {
            "file://"
    };
    /**
     * 从assets文件夹中异步加载图片
     * String imageUri = "assets://image.png"; // from assets
     */
    static String[] FromAssetsImages = {
            "assets://"
    };
    /**
     * 从drawable中异步加载本地图片
     * String imageUri = "drawable://" + R.drawable.image; // from drawables
     */
    static String[] FromDrawable = {
            "drawable://"
    };
    /**
     * 从内容提提供者中抓取图片
     * String imageUri = "content://media/external/audio/albumart/13"
     */
    static String[] FromContent = {
            "content://"
    };
}

加载:

ImageLoader.getInstance().displayImage(imgURL,imgView);

gradle_jar:

// https://mvnrepository.com/artifact/com.nostra13.universalimageloader/universal-image-loader
compile group: 'com.nostra13.universalimageloader', name: 'universal-image-loader', version: '1.9.5'

你可能感兴趣的:(ImageLoader加载本地图片)