简体   繁体   中英

Lollipop: Notification Icon with colour / image?

I am having some confusion with notification icons in relation to its background.

I read that in lollipop, all colours will be translated to white and that the system only processes the alpha channel and ignoring the colour channels.

So my question is how would I go about making a notification icon similar to this: The "Marvel Comics" icon?

在此处输入图片说明

What exactly has to be transparent? because I am getting the same issue as shown here 在此处输入图片说明

I have seen that the solution as described here https://developer.android.com/design/patterns/notifications.html under Use Distinct Icons but what if I wanted an icon just like the marvel one shown in the first image without making it just white?

Thank you for reading

Finally this workaround

Just change your build target sdk to 19 from 21 (or later) in your gradle file (or your manifest for eclipse users). I don't like the idea of targeting a non latest version but in order to have the a colored icon theres seems to be no other choice.

If you still wish to target latest version thenmake do with what @Commonsware suggests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM