【发布时间】:2016-01-31 20:14:57
【问题描述】:
当我在我的 Moto E 上升级到棒棒糖时,小通知图标变成了黑白(我读到它是新的谷歌指南)。所以好吧,我可以忍受它。 现在我注意到图标又变成了颜色,而且我没有更改我的代码并且一直在使用相同的可绘制对象。它肯定是显示黑白的,现在它是彩色的。 我的设备是 Android 5.0.2 另外:
compileSdkVersion 22
buildToolsVersion "22.0.1"
targetSdkVersion 22
这是我的代码:
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
this)
.setVibrate(new long[] { 10, 10, 10, 10, 10 })
.setSound(alarmSound)
.setSmallIcon(R.drawable.logo)
.setContentTitle(title)
.setStyle(new NotificationCompat.BigTextStyle().bigText(msg))
.setContentText(msg);
谁能告诉我这是怎么回事?
【问题讨论】:
-
您曾经/正在使用哪些目标 api/构建工具?
-
buildToolsVersion "22.0.1" 和 targetSdkVersion 22
-
这也取决于drawables,以某种方式发布它们。虽然推荐使用黑白,但您可以在可绘制对象中使用颜色。除了作为通知图标的“徽标”也很可疑之外,看起来您的启动器图标可能混在其中
-
drawable(logo) 只是一个彩色的 png 文件。早些时候我也在使用同一个文件,通知图标变成了黑白
标签: android notifications push-notification android-5.0-lollipop android-drawable