如何创建Android应用程序通知图标徽章(如iPhone)徽章、应用程序、图标、通知

2023-09-05 10:39:32 作者:一切都会过去的

我很新的节目,想知道什么是着手建立类似的iPhone应用软件的用户通知图标徽章的最佳途径。这将是基本上用于创建一个徽章,最终在通知栏的通知。

I am very new to programming and would like to know what is the best way to go about creating a notification icon badge similar to the ones on the iPhone apps. This would be basically for creating a badge for the notifications that end up in the notification bar.

推荐答案

这是实际上是从马克·墨菲回答:

This is actually an answer from Mark Murphy:

对于大多数手机上,您使用的通知对象的号码字段。   看这里:    http://github.com/commonsguy/cw-android/tree/主/通知/ Notify1 /

For most phones, you use the number field of the Notification object. See here: http://github.com/commonsguy/cw-android/tree/master/Notifications/Notify1/

现在,有几部电话由一个主要的设备制造商有   一个bug,其中数场被忽略。我努力让   他们来修复它。所以你不能完全依赖于红色泡沫是   那里,虽然这将是在大多数手机上。

Now, there are a few phones by one major device manufacturer that have a bug, whereby the number field is ignored. I am working on getting them to fix it. So you can't absolutely rely on that red bubble being there, though it will be on most phones.