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

前端 未结 2 1289
名媛妹妹
名媛妹妹 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!

提交回复
热议问题