Glide 4.3.1 override and placeholder features not work

后端 未结 2 2013
梦毁少年i
梦毁少年i 2021-01-17 09:35

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.

相关标签:
2条回答
  • 2021-01-17 10:14

    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);
    
    0 讨论(0)
  • 2021-01-17 10:14

    Try This

    Glide.with(this)
         .load(imageUrl)
         .apply(new RequestOptions().placeholder(R.drawable.ic_launcher).override(200, 200))
         .into(ivAvatar);
    
    0 讨论(0)
提交回复
热议问题