问题
When I try to load image with I get this result:
This is my simple code:
Glide.with(this).load(R.drawable.girl_with_coffee_and_phone)
.placeholder(R.color.colorPrimary)
.into(mBackgroundImage);
This is my activity layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"/>
</RelativeLayout>
Am I doing something wrong?
Logs:
D/OpenGLRenderer: endAllActiveAnimators on 0x7842bfdc00 (InsetDrawable) with handle 0x783169e820
回答1:
try
Glide.with(this).load(R.drawable.girl_with_coffee_and_phone)
.centerCrop()
.into(mBackgroundImage);
remove the android:scaleType param from the xml file.
and in the activity you will have:
ImageView mBackgroundImage= (ImageView)findViewById(R.id.image_background);
回答2:
I check the source and found an workaround solution, just check my project in github
来源:https://stackoverflow.com/questions/39524604/glide-is-loading-half-image