设置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>
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>
相关文章推荐
- Android布局的小窍门?
- Web布局连载——两栏固定布局(五)
- 样式表CSS布局经验
- css网页布局中注意的几个问题小结
- DL.DT.DD实现左右的布局简单例子第1/2页
- 使用CSS框架布局的缺点和优点小结
- div+CSS网页布局的意义与副作用原因小结第1/2页
- DIV border边框显示不完全问题的解决方法
- C#通过重写Panel改变边框颜色与宽度的方法
- Android编程之代码创建布局实例分析
- C#实现Winform无边框移动的方法
- CSS顶级技巧大放送,div+css布局必知
- 纯CSS实现的漂亮的立体图片边框效果,阴影代码
- 用div实现像table一样的布局方法
- JS实现动态给图片添加边框的方法
- 精彩的Bootstrap案例分享 重点在注释!(选项卡、栅格布局)
- JS+CSS实现自适应选项卡宽度的圆角滑动门效果
- jQuery EasyUI 布局之动态添加tabs标签页
- jQuery+html5+css3实现圆角无刷新表单带输入验证功能代码
- 无边框窗口代码详解