错误:(59,17)错误:找不到符号方法crossFade()

时间:2018-03-18 00:25:03

标签: java

您好,我收到错误请告诉我为什么会收到错误

C:\用户\古普塔\ AndroidStudioProjects \ Globlus \应用\ SRC \主\的java \ VG \ globlus \网络\适配器\ GalleryListAdapter.java 错误:(59,17)错误:找不到符号方法crossFade()

error meassge getting here my code

    public ImageView thumbnail;

    public MyViewHolder(View view) {

        super(view);
        thumbnail = (ImageView) view.findViewById(R.id.thumbnail);
    }
}


public GalleryListAdapter(Context context, List<Image> images) {

    mContext = context;
    this.images = images;
}

@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

    View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.gallery_thumbnail, parent, false);

    return new MyViewHolder(itemView);
}

@Override
public void onBindViewHolder(MyViewHolder holder, int position) {

    Image image = images.get(position);

    Glide.with(mContext).load(image.getImgUrl())
            .thumbnail(0.5f)
            .crossFade()
            .diskCacheStrategy(DiskCacheStrategy.ALL)
            .into(holder.thumbnail);
}

1 个答案:

答案 0 :(得分:0)

使用此

compile 'com.github.bumptech.glide:glide:3.7.0'     

如果您正在使用4.x版本的滑行,请执行类似

的操作
GlideApp  
    .with(context)
    .load(UsageExampleListViewAdapter.eatFoodyImages[0])
    .placeholder(R.mipmap.ic_launcher) // can also be a drawable
    .error(R.mipmap.future_studio_launcher) // will be displayed if the image cannot be loaded
    .transition(DrawableTransitionOptions.withCrossFade())
    .into(imageViewCombined);