【问题标题】:Gray circle next to large notification icon?大通知图标旁边的灰色圆圈?
【发布时间】:2015-02-22 09:22:26
【问题描述】:

我在我的应用程序中显示通知 - 但由于某种原因在 android 版本 Lolipop 上它在大图标旁边显示一个灰色圆圈,如下所示:

有人知道为什么会这样吗?

这是我创建通知的代码:

builder = new NotificationCompat.Builder(context)
                    // Set Icon
                    .setSmallIcon(R.drawable.ic_launcher)
                    .setLargeIcon(icon)
                    // Set Ticker Message
                    .setTicker(message)
                    // Set Title
                    .setContentTitle(message)
                    // Set Text
                    .setContentText(context.getString(R.string.app_name))
                    // Add an Action Button below Notification
                    // .addAction(R.drawable.share,
                    // context.getString(R.string.share), pendingShare)
                    // Set PendingIntent into Notification
                    .setContentIntent(contentIntent)
                    // Dismiss Notification
                    .setAutoCancel(true)
                    .setSound(
                            Uri.parse("android.resource://"
                                    + context.getPackageName()
                                    + "/"
                                    + prefs.getInt(Constants.NOTIF_SOUND,
                                            R.raw.al_affassi_full)));

【问题讨论】:

  • 我认为这是你设置的小图标。评论后尝试setSmallIcon(R.drawable.ic_launcher)
  • @PankajKumar 这样通知会发出声音,但不会显示通知。

标签: android android-notifications android-notification-bar android-icons


【解决方案1】:

您的通知图标必须遵循此处的通知设计:iconography notifications

通知图标必须全白。此外,系统可能会缩小和/或使图标变暗。

编辑

试试这张图片(图片是白色的,在 /// 之间)

/// ///

【讨论】:

  • 我已将我的小图标设置为白色和 16x16px 但同样的问题,圆形支架也没有显示里面的图标
  • 你能和我分享你的白色小图标吗
  • 不只是白色,请去掉蓝色,只变成白色,背景透明
  • 好吧,我试试,但我不认为这是这个问题
  • 您可以使用它来制作通知图标(可能与问题无关但仍然值得一看):romannurik.github.io/AndroidAssetStudio/…
猜你喜欢
  • 1970-01-01
  • 2017-03-17
  • 1970-01-01
  • 2022-01-07
  • 1970-01-01
  • 2013-07-24
  • 2021-10-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多