Drawable实现分层,类似于FrameLayout的用法,第二个Item的shape会盖住第一个Item的shape,但是可以通过Item的Top/Bottom/Left/Right等属性实现间距
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- layout background -->
<item>
<shape android:shape="rectangle">
<solid android:color="@color/line"/>
</shape>
</item>
<!-- layout foreground -->
<item
android:top="1px"
android:bottom="1px" >
<shape android:shape="rectangle">
<solid android:color="@color/white"/>
</shape>
</item>
</layer-list>