我是android开发的新手,刚刚创建了我的第一个应用程序。我选择了我的应用程序图标,但不知道为什么我保存的图像的背景,它显示绿色,而原始图像没有。有什么办法可以移除绿色背景。

上面的图片是在android中选择后的图像。
如何去除绿色背景?
提前感谢
发布于 2021-10-12 19:35:04
码结构
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/> // this is background color
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon> 在项目dir中的values/ic_launcher_background.xml中找到颜色资源
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#00FF00</color> // change color using(#) like : #000000(black)
</resources>我提到了黑色颜色代码,您试图根据将颜色更改为图标。
或者像这样使用透明的颜色
<color name="ic_launcher_background">#0000ffff</color> // transparent background color 发布于 2021-10-12 18:15:07
如果您替换了ic_launcher_foreground.xml以更改图标,还需要删除ic_launcher.xml和/或下面的ic_launcher_round.xml中的第三行。
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>在任何情况下,您看到的都是ic_launcher_background.xml In /res/drawable/。删除它,查看哪些中断,并通过删除对已删除的xml的调用来修复它。
https://stackoverflow.com/questions/69545093
复制相似问题