小编Ham*_*ezi的帖子

如何以编程方式将VectorDrawable设置为ImageView的图像

我想在Android Studio 中将一些vectorDrawables设置为ImageView.

我可以轻松设置png和jpg drawable,但是当我想设置VectorDrawable时,它在imageview上不起作用.

img.setImageResource(R.drawable.ic_home);
Run Code Online (Sandbox Code Playgroud)

ic_home是VectorDrawable,此代码不起作用.

android imageview android-vectordrawable

45
推荐指数
4
解决办法
5万
查看次数