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))
     .override(153,160)
     .crossFade()
     .centerCrop()
     .dontAnimate()
     .skipMemoryCache(true)
     .into(holder.thumbnail);

problem is that here .override(153,160) this line showing compile error like cannot resolve method override(int,int)

我在这里找到了解决方案: 尝试了很多方法都不起作用..请任何人帮助我

当我变成这样的时候

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()**

// I am getting error this line .crossFade()

Cross fades

不像 Glide v3 默认情况下不会对请求应用淡入淡出或任何其他过渡。 Transitions 必须手动应用。

要将交叉淡入淡出过渡应用于特定负载,您可以使用:

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 V4 中 crossFade 的正确实现应该是:

Glide.with(this)
     .load(YOUR_URL)
     .transition(withCrossFade())
     .apply(new RequestOptions().override(153,160).placeholder(R.drawable.placeHolder).error(R.drawable.error_pic))
     .into(imageview);

用这个。