我想在Android中使用xml在大型灯光圈内制作一个小黑圈。两个圆圈都有颜色,大小和笔画。为什么小黑圈填充50 dp而不是28dp?内圈为什么会填满外圈?
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!--big light circle-->
<item>
<shape android:shape="oval">
<solid android:color="#EEEEEE" />
<size
android:width="50dp"
android:height="50dp" />
<stroke
android:width="2dp"
android:color="#404040" />
</shape>
</item>
<!--small dark circle-->
<item>
<shape android:shape="oval">
<solid android:color="#AEAEAE" />
<size
android:width="28dp"
android:height="28dp" />
<stroke
android:width="1dp"
android:color="#464646" />
</shape>
</item>
</layer-list>
提拉的使用:
<RadioButton
android:id="@+id/radioButtonPositive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:button="@android:color/transparent"
android:drawableTop="@drawable/ic_choice_background"
android:gravity="center"
android:onClick="onRadioButtonClicked"
android:layout_marginRight="110dp"/>
的XML生成但我想它生成 (与外圆的大小相同,这个截图没有正确显示它)
在哪个版本的Android上测试它? – Blackbelt
该屏幕截图显示了Android Studio中xml文件的“设计”选项卡上显示的内容。它呈现API 23.我已经尝试在4.3,5.0和6.0设备上运行它,并且它们都显示相同。 – Janneman96
奇怪..尝试在-
Blackbelt