您的位置:首页 > 移动开发 > Android开发

android绘制带圆角的editText

2015-08-18 10:36 483 查看
让android中的输入文本框和Bootstrap中的input text一样,方法如下:

在drawable文件夹中创建一个 shape xml 配置文件

在文件中写入如下样式

[code]<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="#FFFFFF"/>
    <stroke
        android:width="1dp"
        android:color="#A0A0A0"/>
    <padding
        android:bottom="10dp"
        android:left="10dp"
        android:right="10dp"
        android:top="10dp"/>
    <corners android:radius="10dp"/>
</shape>


在 EditText 布局文件标签中使用android:background引入shape xml文件

好了这样就完成了一个Bootstrap的input标签样式的android控件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: