问题描述
在我的Android应用中,我想在应用程序图标(例如ios)中显示推送通知徽章计数.
In my Android app,i want to show a push-notification badge count into application icon like ios.
如何在应用程序图标中显示徽章计数?
How can I show badge count into application icon ?
推荐答案
Android没有此特定功能.
Android doesn't have this particular feature.
一种替代方法是让通知显示该数字,但在正常情况下该应用程序图标本身无法运行.
An alternative might be to have a notification that displays the number but the app icon itself is incapable under normal circumstances.
如果您真的想违反设计准则,则可以制作一个看起来像您的应用程序图标的小部件,并且该小部件可以更好地控制其绘制方式.已经发布了一些针对Gmail,Google语音,标准Messaging应用程序的应用程序,但错过了对Phone应用程序的呼叫,它们伪装成常规的应用程序图标,因此有可能.我真的不推荐这种方法,但是可以使用.
If you REALLY wanted to break design guidelines you could make a widget that looks like your app icon and the widget gets much more control over how it's drawn. Some apps have been released to do this for Gmail, Google Voice, the standard Messaging app, and missed called for the Phone app and they masquerade as regular app icons so it is possible. I don't really recommend this approach, but it is available.
这篇关于在Android中的“应用"图标上显示徽章计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!