[英]How can i convert an image to notification icon to use in android app?
I have tried built in tools in android studio using res -> new -> Image Asset and then selecting notification icon.But after selecting the images it shows some grey and black boxes and not image icon and doesn't show in notifications as well.我已经尝试在 android studio 中使用res -> new -> Image Asset内置工具,然后选择通知图标。 I have researched and found that image background should be transparent for it to work but that didn't work also.我已经研究并发现图像背景应该是透明的才能工作,但这也不起作用。 Also i have tried images of 24x24 size as recommended but couldn't get the icon working in my android app.我也试过推荐的 24x24 大小的图像,但无法让图标在我的 android 应用程序中工作。 Thanks in advance for any useful suggestions.在此先感谢您提供任何有用的建议。
For v21 and above--> In notification icon, only white and transparent colors are allowed.对于 v21 及以上版本--> 在通知图标中,只允许使用白色和透明颜色。 Use white color what u want to show, rest part make it transparent.使用您想要显示的白色,其余部分使其透明。
For v20 and below --> You can use any image with proper dimensions.对于 v20 及以下版本 --> 您可以使用具有适当尺寸的任何图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.