位置: 编程技术 - 正文
推荐整理分享异步加载图片框架ImageLoader的使用(ios异步加载图片),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:异步加载图片框怎么弄,异步加载页面,js异步加载图片,异步加载图片框怎么弄,异步加载图片框怎么弄,异步加载组件,异步加载图片框怎么设置,异步加载图片框怎么弄,内容如对您有帮助,希望把文章链接给更多的朋友!
转自: com.example.test.com; import java.io.File; import android.app.Activity; import android.os.Bundle; import android.view.ViewGroup; import android.view.Window; import android.widget.ImageView; import com.nostra.universalimageloader.cache.disc.impl.UnlimitedDiscCache; import com.nostra.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator; import com.nostra.universalimageloader.cache.memory.impl.LruMemoryCache; import com.nostra.universalimageloader.core.DisplayImageOptions; import com.nostra.universalimageloader.core.ImageLoader; import com.nostra.universalimageloader.core.ImageLoaderConfiguration; import com.nostra.universalimageloader.core.assist.QueueProcessingType; import com.nostra.universalimageloader.core.decode.BaseImageDecoder; import com.nostra.universalimageloader.core.download.BaseImageDownloader; import com.nostra.universalimageloader.utils.StorageUtils; public class MainActivity extends Activity { private ImageLoader imageLoader = ImageLoader.getInstance(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); ViewGroup viewGroup = (ViewGroup) getLayoutInflater().inflate(R.layout.main, null); setContentView(viewGroup); getLayoutInflater(); //ImageView对象用于显示图片 ImageView imageView = (ImageView) findViewById(R.id.imageView1); loadImage(imageView); } private void loadImage(final ImageView imageView) { //图片保存系统路径 File cacheDir = StorageUtils.getOwnCacheDirectory(MainActivity.this, "data"); DisplayImageOptions imageOptions = new DisplayImageOptions.Builder().cacheInMemory().cacheOnDisc() .build(); //一些相关的设置 ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(MainActivity.this).threadPoolSize(5) .threadPriority(Thread.NORM_PRIORITY - 1).tasksProcessingOrder(QueueProcessingType.LIFO).denyCacheImageMultipleSizesInMemory() .memoryCache(new LruMemoryCache( * )).memoryCacheSize(1 * * ).discCache(new UnlimitedDiscCache(cacheDir)) // default .discCacheSize( * * ).discCacheFileCount().discCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default .imageDownloader(new BaseImageDownloader(MainActivity.this)) // default .imageDecoder(new BaseImageDecoder()) // default .defaultDisplayImageOptions(imageOptions) // default .enableLogging().build(); //初始化配置 imageLoader.init(config); //显示图片 imageLoader.displayImage(" imageView); } }
Unable to instantiate application io.rong.app.App: java.lang.ClassNotFoundException: -::.:E/ActivityThread():Unabletoinstantiateapplicationio.rong.app.App:java.lang.ClassNotFoundException:Didn'tfindclassio.rong.app.Apponpath:DexPathList[[zipfile/data/app/io.rong.app-
Android Studio如何Format代码 AndroidStudio如何Format代码在Eclipse中,我们一般使用CtrlShiftF来式化代码,AndroidStudio中需要换成:ReformatcodeCTRLALTL(Win)OPTIONCMDL(Mac)
【Android】FragmentTabHost实现底部Tab菜单选项 以前实现类微博底部菜单使用的是TabHostActivity来实现,但是使用的时候提醒已经被弃用,现在我们可以通过FragmentTabHostFragment来实现。下面就是demo:1.mai
标签: ios异步加载图片
本文链接地址:https://www.jiuchutong.com/biancheng/384263.html 转载请保留说明!友情链接: 武汉网站建设