android 控件添加边框

在drawable创建一个xml文件

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <!-- 最外层 -->
    <item>
        <shape>
            <solid android:color="#000000" />
        </shape>
    </item>
    <!-- 内层 -->
    <item
        android:bottom="1dip"
        android:left="1dip"
        android:right="1dip"
        android:top="1dip">
        <shape>
            <solid android:color="#ffffff" />
        </shape>
    </item>

</layer-list>


使用的时候把某个控件的background属性设置为以上的drawable文件,



猜你喜欢

转载自blog.csdn.net/m940034240/article/details/77746758