How to change icon colors in android studio

后端 未结 5 921
一个人的身影
一个人的身影 2021-02-05 04:32

I downloaded some icons from material.io but they only offer the icons in black. I saw a youtube video where they use to allow you to choose the color. Anyway, I am trying to

5条回答
  •  渐次进展
    2021-02-05 05:22

    https://material.io/icons/ actually does let you download icons in white.

    But, depending on what exactly you want to do, there are a few options. If you simply want white icons (and not to change them at runtime), you may find this plugin for Android Studio useful: https://github.com/konifar/android-material-design-icon-generator-plugin

    It allows you to generate the material design icons right in Android Studio, in whatever color you want. Another alternative for downloading these icons in different colors is https://materialdesignicons.com/.

    If you do want to color the icons at runtime, try something like this:

    imageView.setColorFilter(ContextCompat.getColor(context, android.R.color.white), 
            PorterDuff.Mode.MULTIPLY);
    

提交回复
热议问题