简体   繁体   中英

Glide is loading half image

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

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);

我检查了源代码并找到了一个解决方法,只需在github中检查我的项目

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM