Glide.with(context).load("file://" + bitmapList.get(position))显示错误? [英] Glide.with(context).load("file://"+bitmapList.get(position)) showing error?
本文介绍了Glide.with(context).load("file://" + bitmapList.get(position))显示错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用以下代码
Glide.with(context)
.load("file://"+bitmapList.get(position))
.override(153,160)
.crossFade()
.centerCrop()
.dontAnimate()
.skipMemoryCache(true)
.into(holder.thumbnail);
问题在于,此处 .override(153,160)该行显示了编译 诸如无法解决方法 override(int,int)
problem is that here .override(153,160) this line showing compile error like cannot resolve method override(int,int)
我在这里得到了解决方案: glide:4.3.1覆盖和占位符功能不起作用尝试了很多方法都不能起作用..请任何人帮助我
I got solution here: glide:4.3.1 override and placeholder features not work tried manyways it not working..please anyone help me
当我这样改变时
Glide.with(context)
.load("file://"+bitmapList.get(position))
.apply(new RequestOptions().override(153,160))
.crossFade()
.centerCrop()
.dontAnimate()
.skipMemoryCache(true)
.into(holder.thumbnail);
// I am getting error this line **.crossFade()**
推荐答案
//我在这行.crossFade()上出错了
// I am getting error this line .crossFade()
与 Glide v3
不同,默认情况下不会对请求应用交叉渐变或任何其他过渡. Transitions
必须手动应用.
要将交叉淡入淡出过渡应用于特定负载,可以使用:
To apply a cross fade transition to a particular load, you can use:
import static com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade;
Glide.with(this)
.load("https://i.stack.imgur.com/7CChZ.jpg?s=328&g=1")
.transition(withCrossFade())
.apply(new RequestOptions().override(100, 100)
.placeholder(R.drawable.ic_launcher_background)
.error(R.drawable.ic_launcher_background).centerCrop()
)
.into(imageView);
这篇关于Glide.with(context).load("file://" + bitmapList.get(position))显示错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文