18

I update my glide to 4.3.1 but all over I use glide the feature .override() and .placeholder() get error: cannot find symbol method.

Glide.with(this)
            .load(imageUrl)
            .override(200, 200)
            .placeholder(R.drawable.ic_avatar_sign_up)
            .into(ivAvatar);

How can I fix this?

Zoe
  • 27,060
  • 21
  • 118
  • 148
Mohad Hadi
  • 1,826
  • 3
  • 24
  • 39

2 Answers2

40

You should use RequestOptions

Includes methods like:

  • centerCrop()
  • placeholder()
  • error()
  • priority()
  • diskCacheStrategy()
  • priority()
  • override(100, 100)
  • transforms()

Sample code

Glide.with(this)
     .load(YOUR_URL)
     .apply(new RequestOptions().override(100, 100).placeholder(R.drawable.placeHolder).error(R.drawable.error_pic))
     .into(imageview);
Goku
  • 9,102
  • 8
  • 50
  • 81
4

Try This

Glide.with(this)
     .load(imageUrl)
     .apply(new RequestOptions().placeholder(R.drawable.ic_launcher).override(200, 200))
     .into(ivAvatar);
Goku
  • 9,102
  • 8
  • 50
  • 81
Ratilal Chopda
  • 4,162
  • 4
  • 18
  • 31