让android中的输入文本框和Bootstrap中的input text一样,方法如下:
- 在drawable文件夹中创建一个 shape xml 配置文件
- 在文件中写入如下样式
<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控件