简体   繁体   English

如何将图像转换为通知图标以在 android 应用程序中使用?

[英]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 及以下版本 --> 您可以使用具有适当尺寸的任何图像。

Refer here for details.有关详细信息,请参阅此处

暂无
暂无

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

相关问题 应用程序运行android时,如何在通知区域放置通知图标? - How can I put notification icon in notification area while app is running android? 我们如何在 android 通知图标中使用多色图标 - How can we use multi color icon in android notification icon 如何在android中调整图像大小以在扩展通知中使用它? - How can I resize an image in android to use it in an expanded notification? 我可以将 android 中的默认推送通知图标从应用程序图标覆盖到自定义图标吗? - Can I override default push notification icon in android from app icon to custom icon? 如何以编程方式使用 android studio 4.2.1 将我的应用程序图标设置为一个信号通知 - How can i set my app icon to one signal notification using android studio 4.2.1 programatically 如何从Android自定义通知中删除header信息(包括小图标、应用名称)和展开图标? - How can I remove header information (which includes small icon, app name) and expand icon from the Android custom notification? 如何在Android中为通知区域和通知抽屉使用不同的通知图标 - How to use different notification icon in Android for the notification area and the notification drawer 如何在Android中使用共享图标 - How can I use the share icon in android 我们如何在Android中以编程方式为“锁定屏幕通知和徽章图标”等应用启用通知设置 - How can we enable notification setting in android for app like “lock screen notification and badge icon” programatically 如何在Android的启动画面中使用应用程序图标以外的图像 - How to use an image other than the app icon in the splash screen for android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM