[英]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.您可以使用
android:scaleType="centerCrop"
属性与您的视图确保您使用android:src="@drawable/xyz"
设置您的可绘制不是android:background="@drawable/xyz"
在 orderground 中设置为 workback="@drawable/": .
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.