简体   繁体   中英

Android How to Remove white space / padding around vector asset in ImageView?

I would like to remove the white space around my vector assets, I'm not sure how to do that. My files do not have any white space around them. The issue ( I would like it to be like the red border I drew in paint): 在此处输入图像描述

This is one of my files:

在此处输入图像描述

You can use android:scaleType="centerCrop" property with your view make sure you are using android:src="@drawable/xyz" to set your drawable not android:background="@drawable/xyz" in order for this to work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM