You might have realized from the latest versions of Glide Image Loader, it does not resolve methods such as placeholder(drawable), fitCenter(), e.t.c. Under this walkthrough, we are going to see how to solve this Glide Library Placeholder problems.
Glide Image Caching library, can’t resolve the placeholder method
You might think that this is a problem or maybe the newest versions of Glide are missing some important features. Well, that not the case, you can still use the .placeholder() with the latest versions of Glide, you just have to add it as applied RequestOption in the method chain. Please have a look at the code below
package ke.co.potent_mshop.mshopmarket; import android.content.Context; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; public class GlideTestingApplication { private void loadingTesting(Context context, ImageView imageView){ Glide.with(context).load("image url").apply(new RequestOptions().placeholder(R.drawable.ic_launcher_background)).into(imageView); } }
Feel free to copy paste the code into your project files. You can still watch the following video to see how to figure out this
VIDEO: Glide Library Placeholder issues solved
My name is Benson Karue, I was Software Engineer Telenet Co LTD before I quit and joined YouTube and Udemy as an instructor. I have real-world software experience and have a Bachelor’s degree in Mathematics and Computer Science with 6+ years of coding experience and winning several competitions and coding challenges.
I am familiar with C, C++, C#, Objective-C, Java, Swift, Android, iOS, Windows mobile, J2ME, Blackberry, HTML5, CSS3, JavaScript, Jquery, AJAX, Node.js, PHP, Ruby, Python, Scala, Groovy, PhoneGap JSP, JSF, EJB, Struts, Hibernate and Spring MVC, Flat Design along with databases such as MySQL, Oracle, SQLServer, SQLite and many other technologies and frameworks