繁体   English   中英

Glide正在加载半张图像

[英]Glide is loading half image

当我尝试加载图像时,我得到了这个结果:

结果

这是我的简单代码:

Glide.with(this).load(R.drawable.girl_with_coffee_and_phone)
                .placeholder(R.color.colorPrimary)
                .into(mBackgroundImage);

这是我的活动布局:

<?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>

难道我做错了什么?

日志:

D/OpenGLRenderer: endAllActiveAnimators on 0x7842bfdc00 (InsetDrawable) with handle 0x783169e820

尝试

  Glide.with(this).load(R.drawable.girl_with_coffee_and_phone)
                .centerCrop()
                .into(mBackgroundImage);

从xml文件中删除android:scaleType参数。

在您将要进行的活动中:

ImageView mBackgroundImage= (ImageView)findViewById(R.id.image_background);

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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