0
我已经创建了一个图层列表,但它并不完美。这里是层列表中的Android XML:Android - 图层列表椭圆形状有额外的内线
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval">
<size
android:width="200dp"
android:height="200dp" />
<solid android:color="#5BB534" />
</shape>
</item>
<item
android:left="25dp"
android:top="25dp"
android:right="25dp"
android:bottom="25dp">
<shape>
<solid android:color="#4335BA" />
</shape>
</item>
<item
android:left="30dp"
android:top="30dp"
android:right="30dp"
android:bottom="30dp">
<shape
android:shape="ring"
android:thickness="20dp"
android:useLevel="false">
<solid android:color="#BFB637" />
</shape>
</item>
</layer-list>
,这里是我在哪里应用层列表:
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:text="Hello World!" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/mylayerlist"
android:layout_below="@id/tv"/>
下面是最终产品:
请注意,这条线粘在圆内。我只想要一个完美的圈子。我希望它看起来像这样(或多或少,刚刚摆脱的小线伸出):
你能告诉我什么样的XML代码块所做的事:<项目 机器人:左= “25dp” 机器人:顶部= “25dp” 机器人:右= “25dp” android:bottom =“25dp”>具有这些边界的项目究竟意味着什么,这是否意味着创建一个具有此测量值的矩形? – j2emanue
矩形与填充25dp和视图的大小。它应该使用你的方法,但它似乎是一个小错误 –