How to set VectorDrawable as an image for ImageView programmatically

后端 未结 8 1583
梦如初夏
梦如初夏 2020-12-13 05:58

I want to set some vectorDrawables to a ImageView in Android Studio.

I can set png and jpg drawable easily but when i want to set V

8条回答
  •  無奈伤痛
    2020-12-13 06:03

    I had a vector in recycler view I was using img.setImageResource(R.drawable.ic_home) which didn't worked properly like some other image get formed in some item of recycler view. Then I used img.setImageDrawable(activity.getResources().getDrawable(R.drawable.ic_home)) this worked .

提交回复
热议问题