-1

All of the Android material icons come in either black or white:

https://www.google.com/design/icons/index.html

Which I add to my layout like:

<ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/ic_plus" />

Is there a way to change the color of the icon from black/white to something else in the layout/code?

I've heard of the android:backgroundTint="@color/green" property, but does this work across all versions of Android? For example, if I use this property in my layout, will it change the color on Android versions older than 5.0?

Edit: Wow, you guys are good at making a new user feel unwelcome.

user5645856
  • 25
  • 1
  • 3
  • you cant do that in xml i am afraid. create a new icon with your prefered color or try using Colorfilter/Tint in code t – Dhinakaran Thennarasu Dec 10 '15 at 05:21
  • Use Colorfilter for that. – Piyush Dec 10 '15 at 05:22
  • You question has been answer at this topic: http://stackoverflow.com/questions/27735890/lollipops-backgroundtint-has-no-effect-on-a-button. Hope this help! – Lan Nguyen Dec 10 '15 at 05:23
  • By giving background(color) to the image it is not set to the icon, of that you have to create a new image or simple change the color of that icon in gimp or photo-shop – Sumit Pathak Dec 10 '15 at 05:55
  • android:backgroundTint does not work across all versions of Android. It will only work on API level 21 above. See the documentation >> http://developer.android.com/reference/android/R.attr.html#backgroundTint – mgcaguioa Dec 10 '15 at 06:16

1 Answers1

0

I think, It is not possible to all android versions.

you can design icon color in this website.()

Note: Google Designs icons also available in this website.

Icon generators allow you to quickly and easily generate icons from existing source images, clipart, or text.

http://romannurik.github.io/AndroidAssetStudio/

Venkatesh Selvam
  • 1,382
  • 2
  • 15
  • 28