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?
If you want to use Jquery$(". material-icons"). css("color", themeColor); This will change color of the material icons inside an element eg input field.
Search for and select Open App, and then, on the New Shortcut page, tap Choose. Locate the app whose appearance you want to change. Back on the New Shortcut page, you'll see the app name; tap More (three dots), change the app's name, tap its icon, select Color, and choose a new color.
Use app:drawableTint="@color/yourColor" in the xml instade android:drawableTint="@color/yourColor" . It has the backward compatibility.
A color value defined in XML. The color is specified with an RGB value and alpha channel. You can use a color resource any place that accepts a hexadecimal color value. You can also use a color resource when a drawable resource is expected in XML (for example, android:drawable="@color/green" ).
For changing icon color try
<ImageButton android:layout_width="your value" android:layout_height="your value" /* and so on ... */ android:tint="YourColor" />
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 can use the TintImageView
within the appcompat support library and then tinting/coloring the imageview is by simply calling the android:backgroundTint
to tint the imageview into one color.
Xml
<TintImageView android:layout_width="" android:layout_height="" android:src="" android:backgroundTint="@color/green"/>
or
<ImageView android:tint="the_color_you_want"/>
Programatically
ImageView yourImageView = findViewById(...) yourImageView.setColorFilter(Context.getColor(your_color_here))
So the above xml will tint the imageView to color green, means that it will colorize each pixel of the imageview that are visible to green.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With