本文介绍了setColor 小图标通知 android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 NotificationCompat.Builder 的 setColor 方法更改了图标的顶部颜色和应用程序名称,问题是显示的颜色与提供的颜色不匹配,因为它在通知中变暗了.我的颜色是#21bbe6我确实发现 Android N 通知标题和图标颜色更深,但我仍然不明白为什么,以及如何处理它.https://imgur.com/a/6nx4EsA

I change the top color of the icon and the app name by using setColor method of the NotificationCompat.Builder, The problem is that the displayed color doesn't match the provided one as it gets darker in the notification.my color is #21bbe6I did find out Android N notification title and icon color is darker, but I still don't understand why, and how to deal with it.https://imgur.com/a/6nx4EsA

推荐答案

Google 决定在使用 setColor 时限制 Notification 中可接受的颜色.这是无证的!

Google decided to restrict acceptable colors in Notification when using setColor.It's undocumented!

这篇关于setColor 小图标通知 android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 14:06