Using Glide to load bitmap into ImageView

后端 未结 4 1355
天涯浪人
天涯浪人 2020-12-05 11:38

How can i use Glide library to load Bitmap into my ImageView? I want to create a custom image with text and load it into imageview using Glide.

This

4条回答
  •  渐次进展
    2020-12-05 12:19

    According to the documentation, I don't think the load() method can take a Bitmap as parameter. The image source (i.e., the parameter) could be a URL, drawable resource, and file.

    However, if you want to load a Bitmap into an ImageView, you don't need to use the Glide library. Just use the below statement

    holder.imgPhoto.setImageBitmap(imageWithText("Random text"));
    

提交回复
热议问题