EditText
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="使用android:digits属性(输入数字)"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
android:textColor="#000000"
android:background="#ffffff"
android:layout_margin="10dp"
android:digits="0123456789"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="使用android:numeric属性(输入有符号的浮点数)"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
android:textColor="#000000"
android:background="#ffffff"
android:layout_margin="10dp"
android:numeric="decimal|signed"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="使用android:inputType属性(输入数字)"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
android:textColor="#000000"
android:background="#ffffff"
android:layout_margin="10dp"
android:inputType="number"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="使用android:digits属性(输入26个小写字母)"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
android:textColor="#000000"
android:background="#ffffff"
android:layout_margin="10dp"
android:digits="abcdefghijklmnopqrstuvwxyz"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="使用android:inputType属性(输入Email)"
/>
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
android:textColor="#000"
android:background="#fff"
android:layout_margin="10dp"
android:inputType="textEmailAddress"
/>
</LinearLayout>
更多相关文章
- android 自定义View中获取系统属性
- Android(安卓)TextView跑马灯抖动问题
- Android布局属性详解
- GridView, ListView 区别
- Android:configChanges 属性
- android自定义属性 format类型
- 安卓如何限制横屏和竖屏
- Android学习笔记之mainfest文件中android属性
- android studio连接adb,远程调试