I'm actually trying to use colored icons in my app. I've downloaded the official material design icon pack from here. Now all the icons in this pack are either white, grey or black. But I want the icons to be of a different color. Something like the icons on the left side in this image. The phone phone and mail icons are blue. How can I accomplish this?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I was looking for the same thing but to change it dynamically in the code. I hope this helps someone looking for the same thing.
Create an ImageView for the icon and use setColorFilter on that view.
How to change material icon color in XML
Yes, it's possible and it's simple using this library: https://github.com/jrvansuita/IconHandler
You can easily call this:
As the icon file is in .png format, you should change the color using the tool from which you've created icon. and add it using ImageAsset into project .
For changing icon color try
Note: the tint color is painted ontop of the image, not a replacement color. So tint
#80ff0000
on a black image gives you 50 % red on black, not 50 % red on the background. I.e. this is not equivalent to iOS template images.you change color by changing android:fillColor="#ca0f0f"