Glide is loading half image

 ̄綄美尐妖づ 提交于 2019-12-10 17:44:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!