2017-01-26 174 views
2

我想在圆圈内绘制小圆点。如何在XML中的实心圆圈内绘制小圆圈/圆点?

enter image description here

这是与冲程,我的XML代码。

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="oval"> 
    <stroke 
     android:width="4dp" 
     android:color="#444444" /> 
    <solid android:color="#FF0000" /> 
</shape> 

enter image description here

回答

1

使用层列表标签

<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 
<!-- Large red circle --> 
<item> 
    <shape 
     android:shape="oval"> 
     <stroke 
      android:width="1dp" 
      android:color="#000000" /> 
     <solid android:color="#FF0000" /> 
     <size 
      android:width="40dp" 
      android:height="40dp"/> 
    </shape> 
</item> 

<!-- Small black circle --> 
<item android:right="3dp" 
    android:left="-3dp" 
    android:top="3dp" 
    android:bottom="-3dp"> 
    <shape android:shape="oval"> 
     <stroke android:color="@android:color/transparent" 
      android:width="35dp"/> 
     <solid android:color="#000"/> 
     <size 
      android:width="5dp" 
      android:height="5dp"/> 
    </shape> 
</item> 

修改您所选择的利润和规模

+0

我尝试这一点,但我仍掌握相同的红色圆圈黑色笔画代码,我在您的意见下面添加

+0

我更新了答案。一探究竟。我认为这就是你想要的 –