Java 如何在幻灯片上显示gif
我想在回收器适配器中的Glide error()上显示gif。 我该怎么做 我想在Glide中显示图片,当internet断开连接时,我会显示Gif,但Glide Gif不会显示。 这是我的滑动代码,它只显示loading\u back.gif,没有显示connection\u fail.gifJava 如何在幻灯片上显示gif,java,android,gif,android-glide,Java,Android,Gif,Android Glide,我想在回收器适配器中的Glide error()上显示gif。 我该怎么做 我想在Glide中显示图片,当internet断开连接时,我会显示Gif,但Glide Gif不会显示。 这是我的滑动代码,它只显示loading\u back.gif,没有显示connection\u fail.gif RequestOptions options = new RequestOptions() .centerCrop() .placeholder(R.d
RequestOptions options = new RequestOptions()
.centerCrop()
.placeholder(R.drawable.static_place_holder)
.error(R.drawable.connection_fail)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.priority(Priority.HIGH);
Glide.with(context)
.load(items.get(pos).getLinks())
.apply(options)
.thumbnail(Glide.with(context).load(R.drawable.loading_back))
.thumbnail(Glide.with(context).load(R.drawable.connection_fail))
.into(holder.imageView);
来自和问题
build.gradle(应用程序级)
使用
可能重复的
dependencies {
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
}
Glide.with(context)
.load(imgUrl)
.asGif()
.placeholder(R.drawable.img)
.crossFade()
.into(imageView);