【问题标题】:Removing an imageview background color删除 imageview 背景颜色
【发布时间】: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


【解决方案1】:

查看图片,它的背景为白色。尝试添加透明图像,您的问题将得到解决。我删除了该图像的背景。看看这两个图像之间的区别。

【讨论】:

  • 感谢回复,如果你的意思是我用的是png图片,那不行,因为我没有写webservice,我只知道每张图片都会转换成jpg文件....跨度>
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-29
  • 1970-01-01
  • 2016-10-25
  • 1970-01-01
相关资源
最近更新 更多