简体   繁体   English

如何在flutter中更改图标的背景颜色

[英]How to change the background color of an icon in flutter

My page's background is white(#ffffff), and when I render an icon and set it's color I find that its background color is not white or transparent, but some color like gray forming a square, so how to set it transparent?我页面的背景是白色的(#ffffff),当我渲染一个图标并设置它的颜色时,我发现它的背景颜色不是白色或透明的,而是一些像灰色这样的颜色形成一个正方形,那么如何将它设置为透明?

在此处输入图片说明

Did you use an image/asset as icon ?您是否使用图像/资产作为图标?

If you used image as icon in the app, it is not possible to set transparent background with code in flutter/dart .如果您在应用程序中使用image作为图标,则无法在flutter/dart使用代码设置透明背景。

You can edit the image in editing picture software and then use in app.您可以在编辑图片软件中编辑图像,然后在应用程序中使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM