Could not find class 'android.graphics.drawable.RippleDrawable'

前端 未结 2 1290
名媛妹妹
名媛妹妹 2020-12-06 18:42

I\'m using a third party library, there is a method using DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN);. When I test my app in android 5.0+,ther

相关标签:
2条回答
  • 2020-12-06 18:51

    Read this :

    If you look at the source code for DrawableCompat you will see that for any version < support library 21 the method does nothing.

    The idea of DrawableCompat seems to be simply not crashing on old versions, rather than actually providing that functionality.

    UseFul Tips :

    With support library 22.1 you can use DrawableCompat to tint drawables.

    DrawableCompat.wrap(Drawable) and setTint(), setTintList(), and setTintMode() will just work: no need to create and maintain separate drawables only to support multiple colors!

    0 讨论(0)
  • 2020-12-06 19:11

    i used ?colorPrimary for creating button background and its sake error in my project , and i change ?colorPrimary to @color/colorPrimary and its work for me :)

    0 讨论(0)
提交回复
热议问题