首页 > 解决方案 > 没有白色背景的图像视图

问题描述

我有一个透明图像,当我添加到我的图像视图中时,它看起来像这样

折断

但我想删除图像的白色背景。我只需要显示图像中的男孩并删除白色背景

有什么办法可以做到吗???我是一切,但不能删除这个背景这是我的代码:

<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="110dp"
android:layout_height="150dp"
android:layout_margin="5dp"
app:cardCornerRadius="9dp"
app:cardElevation="10dp"
android:id="@+id/cardview"
android:background="@null" >

  <ImageView
        android:id="@+id/category_item"
        android:layout_width="110dp"
        android:layout_height="150dp"
        android:layout_gravity="center"
        android:background="@null" />

标签: android

解决方案


我知道这很明显,但我说也许你忘了

你确定你的图片是PNG吗!!!?

对于没有背景图像,您必须使用 png 格式


推荐阅读