Android每日范例——密码输入框
2015-10-10 21:05
423 查看
密码输入框的使用方法
在XML布局中添加EditText控件,使用EditText控件的属性进行限定
未限定代码:
android:password值为true或者false,表示当前为输入密码框,即输入的字符是不可见的
限定代码:
有时候会对密码长度进行限制,或者对密码的输入类型进行限定
android:numeric表示对输入的类型进行限制
android:maxLength表示的输入的最长字符长度
注
EditText还有许多的限定方式,例如maxLines等等,需要的可以自己查询一下
在XML布局中添加EditText控件,使用EditText控件的属性进行限定
未限定代码:
android:password值为true或者false,表示当前为输入密码框,即输入的字符是不可见的
[code] <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint = "请输入用户名"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:password="true" android:hint="请输入密码"/>
限定代码:
有时候会对密码长度进行限制,或者对密码的输入类型进行限定
[code] <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:maxLength="10" android:numeric="integer" android:password="true" android:hint="请输入密码"/>
android:numeric表示对输入的类型进行限制
android:maxLength表示的输入的最长字符长度
注
EditText还有许多的限定方式,例如maxLines等等,需要的可以自己查询一下
相关文章推荐
- Binder进程间通信系统
- Android笔记--实现广播的使用
- Android笔记---使用ViewFlipper组件实现文本上下滑动效果
- Android 项目(详解三)—— 数据库类
- Android-ContentProvide
- android等待对话框
- 黑马android - 学习笔记
- 如何在Android市场进行应用认领与apk签名
- Android笔记--实现Android4.1.2对home键的屏蔽
- 百度地图生成API Key 获取Android签名证书的sha1值
- Android studio 使用SVN需要忽略的文件
- Android Fragment 组件学习
- Android5.0水波纹改进
- android官方技术文档翻译——Android Lint(转)
- 安卓基础——adb相关内容
- 使用Gradle发布Android开源项目到JCenter
- DialogFragment 创建对话框
- Android备忘录
- android、java将集合逆序排列
- Android有趣的开源框架