android - 没有白色背景的图像视图
问题描述
我有一个透明图像,当我添加到我的图像视图中时,它看起来像这样
但我想删除图像的白色背景。我只需要显示图像中的男孩并删除白色背景
有什么办法可以做到吗???我是一切,但不能删除这个背景这是我的代码:
<?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" />
解决方案
我知道这很明显,但我说也许你忘了
你确定你的图片是PNG吗!!!?
对于没有背景图像,您必须使用 png 格式
推荐阅读
- javascript - 在数组中查找具有给定字母的单词
- python - pymongo 获取所有集合的键
- r - 用R中的表格列制作堆积条形图
- tensorflow - 用于多类分割的 Dicescore
- c# - WPF ListView 上下文菜单
- amcharts - 使用 amCharts,如何在系列上方添加单个标签?
- c++ - 使用 libcurl 在 smtp 服务器上进行身份验证失败
- elasticsearch - elasticsearch java客户端解析聚合json查询
- api - 如何使用 API 从 PayU 获取所有订单?
- java - 将 AlertDialog 与 AutoCompleteText 结合使用