How to use setImageTintList() on Android API < 21

后端 未结 3 1870
走了就别回头了
走了就别回头了 2021-02-07 11:48
imgView.setImageTintList(getResources()
      .getColorStateList(R.color.my_clr_selector));

It says \'Call requires API level 21\'.

How can I m

3条回答
  •  礼貌的吻别
    2021-02-07 11:57

    ImageViewCompat.setImageTintList(ivImage, ColorStateList.valueOf(ContextCompat.getColor(context, R.color.primaryColor)));
    

提交回复
热议问题