android - 为什么我的通知小图标总是灰色的?

标签 android notifications icons material-design

我尝试将小图标精确制作为 16x16,灰度化,只有灰色和白色(灰色为 hex 值 616161),以创建我的应用程序图标的轮廓。

然而,无论它在通知中只显示为白色/灰色方 block 。我做错了什么?

(我的最小 api 是 21,假设它是相关的)

最佳答案

关注this link

先了解一下Android文档如下

“Update or remove assets that involve color. The system ignores all non-alpha channels in action icons and in the main notification icon. You should assume that these icons will be alpha-only. The system draws notification icons in white and action icons in dark gray.”

现在这很容易被忽略,我看到应用商店中的许多应用都有成千上万的用户没有遵循上述指南。

那么让我详细解释一下如何通过点击几下将通知图标转换为 Android 友好的图标。

在您最喜欢的图像编辑器中打开您的图标文件。将您不想显示的图像的所有部分转换为透明像素。所有颜色和非透明像素都以白色显示。让我们来看一个例子。

enter image description here

已编辑:感谢@Andrey Patseiko tool

关于android - 为什么我的通知小图标总是灰色的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54084498/

相关文章:

ruby-on-rails - Rails 5 - 如何恢复/删除已经广播的通知?

Android前台服务通知未显示

java - 适用于 Android slider 菜单的 slider 图标

jquery-ui - 我可以为 jQueryUI 按钮设置自定义图标吗

android - 如何在xml中的框架布局中嵌套约束布局?

android - 为什么apk大小增加不同的Android版本

java - 如何从android中的文本中提取所有URL

android - getLayoutInflator 和 (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE) 有什么区别

ios - 使用 Swift 3 中的日期选择器中的触发日期安排每周可重复的本地通知

ios - 无法识别的字体系列 ‘Ionicons’ 错误 - Native Base