Android how to resize (scale) an xml vector icon programmatically
问题 This is driving me crazy. I would like to be able to resize an xml vector drawable icon programmatically in order to use it in an ImageView. This is what I've done so far which is not working Drawable drawable = ResourcesCompat.getDrawable(getResources(),R.drawable.ic_marker,null); drawable.setBounds(0,0,512,512); imageVenue.setImageDrawable(drawable); The vector icon ic_marker is not resized. It just keeps the hardcoded width and height values every time. Any ideas? 回答1: You can change the