为什么我的通知小图标总是灰显? [英] Why is my smallIcon for Notifications always greyed out?

查看:26
本文介绍了为什么我的通知小图标总是灰显?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

解决方案

Follow

感谢@Andrey Patseiko 的 工具

I tried making the small icon exactly 16x16, gray-scaled, nothing but gray and white (the gray color being hex value 616161), to create a silhouette of my application icon.

Yet no matter what it just shows up as a white/gray square in the notifications. What am I doing wrong?

(My min api is 21, assuming it is relevant)

解决方案

Follow this link

First let’s understand the Android documentation which is as follows

"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."

Now this is easy to miss and I have seen many apps that are live in the app store with thousands of users who haven’t followed the mentioned guidelines.

So let me explain in detail how you can convert your notification icon to an Android friendly one with a few clicks.

In your favourite image editor open up your icon file. Convert all parts of the image that you don’t want to show to transparent pixels. All colors and non transparent pixels are displayed in white. Let us go through an example.

EDITED: Thanks @Andrey Patseiko for the tool

这篇关于为什么我的通知小图标总是灰显?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆