Glide无法解决其方法 [英] Glide does not resolve its method

查看:84
本文介绍了Glide无法解决其方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我试图在我的android应用程序中使用Glide图像加载器,而与此同时我却面临着无法解决问题的方法.

Today I'm trying to use Glide image loader in my android application while using this I had facing method not resolving problem.

Glide
     .with(this)
     .load(R.drawable.image_default_profile_picture)
     .into(mUserImage);

此代码工作正常.但是当我尝试这个

This code working pretty fine. But when I'm trying this

Glide
     .with(this)
     .load(R.drawable.image_default_profile_picture)
     .placeholder(R.mipmap.ic_launcher)
     .fitCenter()
     .into(mUserImage);

这句话不能解决方法fitCenter()placeholder. 我想念的是什么?

Then this saying cannot resolve method fitCenter(), placeholder. What I am missing?

推荐答案

似乎更新的库有任何问题.添加 .apply(new RequestOptions() 以继续使用最新版本.

Seems like updated library has any issue. Add .apply(new RequestOptions() to continue with latest version.

代码

Glide
 .with(this)
 .load(R.drawable.image_default_profile_picture)
 .apply(new RequestOptions()
 .placeholder(R.mipmap.ic_launcher)
 .fitCenter())
 .into(mUserImage);

这篇关于Glide无法解决其方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆