How to fit VectorDrawable to ImageView and remove unnecessary paddings

守給你的承諾、 提交于 2019-12-02 02:49:20

You should get a whole drawable with the circle and person in one vector. But if you really need these two files to be separated, you must change the path in the XML code.

Accordingly to this https://stackoverflow.com/a/50114171/3368784 you can resize your path by rewriting your primary_dark_color_circle.xml as:

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">
    <group
        android:pivotX="12"
        android:pivotY="12"
        android:scaleX="1.2"
        android:scaleY="1.2">
        <path
            android:fillColor="#0088CC"
            android:pathData="M12,12m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0" />
    </group>
</vector>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!