如何只设置圆圈大小(in xml)?

How to set up only circle size(in xml)?

我想设置圆圈大小,但我不想调整图层列表中其他元素的大小。 我有这个代码:

<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">

<item>
    <shape android:shape="rectangle">
        <solid android:color="@color/drawer_color" />
    </shape>
</item>
<item>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="oval">
        <gradient
            android:endColor="#1b2727"
            android:centerColor="#1a2a29"
            android:startColor="#154440"
            android:type="linear"
            android:angle="90"/>
        <size
            android:height="600dp"
            android:width="600dp" />
        <stroke
            android:width="3dip"
            android:color="@color/drawer_ring_color" />
    </shape>
</item>


</layer-list>

我发现了什么:

还有我想看的:

怎么做? 谢谢!

尝试在您的代码中设置 padding

<item>
    <shape android:shape="rectangle">
        <solid android:color="@color/drawer_color" />
        <padding
            android:left="10dp"
            android:top="100dp"
            android:right="10dp"
            android:bottom="100dp" />
    </shape>
</item>

不幸的是,这不会以这种方式工作,您的可绘制对象将采用您使用该可绘制对象的视图的大小。