Use Glide load into Imageview but delay

后端 未结 2 1496
礼貌的吻别
礼貌的吻别 2021-01-28 11:16

I use Glide to load my ImageView from Firebase.

When I am running my application, my ImageView will delay(like the tooth in my video), https://www.youtube.com/watch?v=6M

相关标签:
2条回答
  • 2021-01-28 11:46

    Try the following to add placeholder

    RequestOptions requestOptions = new RequestOptions();
    requestOptions.placeholder(R.mipmap.ic_launcher);
    requestOptions.error(R.drawable.error_img);
    
    Glide.with(this)
                .setDefaultRequestOptions(requestOptions)
                .load("")
                .into(imageViewPlaceholder);
    

    or use apply instead of setDefaultRequestOptions

    Glide.with(MainActivity.this)
            .load(url)
            .apply(requestOptions)
            .into(imageview);
    
    0 讨论(0)
  • 2021-01-28 11:54

    try using the inbuilt FirebaseLoader image loader

    StorageReference storageReference = //make a Reference to your Image
    Glide.with(context)
       .using(new FirebaseImageLoader())
       .load(storageReference)
       .into(ImageView);
    
    0 讨论(0)
提交回复
热议问题