【发布时间】:2019-05-23 06:59:24
【问题描述】:
我正在使用Glide library 下载图像并在我的适配器中显示它们,问题是,在它设置图像后,它们会得到一个不在下载图像中的背景,ImageView 将此颜色添加到他们
这是一个例子:
你可以看到它有一个非常浅的绿色背景颜色,它自己的图像有白色背景。
到目前为止我尝试过的事情:
- 在我的
xml layout中设置白色背景色 - 设置
transparent background color - 在我的适配器中使用了
View.setBackgroundColor(Color.TRANSPARENT) - 在适配器中使用了
View.setBackgroundColor(0x00000000)
没有任何效果... 我怎样才能摆脱它?
::编辑
附上的布局文件:
<?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/flag"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:adjustViewBounds="true"
android:backgroundTint="#fff"
android:background="#fff" />
</RelativeLayout>
【问题讨论】:
-
你可以添加你的图片网址吗?
-
可以附上原图吗?
-
你能发布你的布局文件吗?背景可能不在 imageView 中。
-
尝试在滑行请求选项中使用 fitcenter
-
这是您发布的另一张图片
标签: android android-imageview android-glide android-image