您的位置:首页 > 其它

设置editText的四周边框-圆角边框

2015-12-01 16:32 302 查看
把下面的代码保存到res/drawable/edittext.xml,在layout中的EditText添加属性android:background="@drawable/edittext"

edittext.xml的代码如下:

<?xml version="1.0" encoding="utf-8"?>

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item>

        <shape

            xmlns:android="http://schemas.android.com/apk/res/android"

            android:shape="rectangle" >

            <solid android:color="#EFEFEF" />

            <corners

                android:bottomLeftRadius="5dip"

                android:bottomRightRadius="5dip"

                android:topLeftRadius="5dip"

                android:topRightRadius="5dip" />

            <stroke

                android:width="0.5px"

                android:color="#505050" />

        </shape>

    </item>

</layer-list>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息