【发布时间】:2015-08-28 17:28:27
【问题描述】:
我正在创建一个应用程序,我能够正确显示通知,但没有显示小图标,正如我在可绘制文件夹中提到的那样,该图标被白色掩盖。任何人都可以帮助我,我怎样才能让图标正常显示。
以下是我的通知代码:
nb = new NotificationCompat.Builder(context)
.setContentTitle(contentTitle)
.setContentText(contentText)
.setSmallIcon(icon)
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.micon_notification))
.setWhen(when)
.setContentIntent(contentIntent)
.setAutoCancel(true)
.setOnlyAlertOnce(true)
.setTicker(tickerText)
.setColor(Color.RED);
drawable中提到的图标如下图:
[1]: http://i.stack.imgur.com/ggYCY.png
图像中出现的完全红色消失了,图标显示为完全白色。欢迎所有建议。
【问题讨论】:
标签: android android-5.0-lollipop android-notifications