安卓android LinearLayout添加边框

<?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/border_line" />

        </shape>

    </item>

    <item android:bottom="1dp" android:top="1dp">

        <shape android:shape="rectangle">

            <solid android:color="@color/white" />

        </shape>

    </item>

</layer-list>

 <LinearLayout

        android:layout_width="match_parent"

android:layout_height="wrap_content"

android:orientation="vertical"

android:background="@drawable/border">

。。。

</LinearLayout>

相关推荐