android studio布局密码框,android studio建立android项目(4)——EditText密码输入框的使用...

一、项目需求

本项目是一个安卓项目,启动页面有一个输入框。输入框的属性以下:

(1)宽高:包裹内容便可

(2)密码输入框

(3)文字提示为:请输入密码(不超过5个字符);提示文字颜色:colorPrimary;

(4)输入字符不超过5个

二、项目分析

考察EditText属性:

(1)密码输入框 inputType为textPassword

(2)提示文字 hint ,textColorhint

(3)最多字符数 maxLength

三、布局文件

xmlns:tools="http://schemas.android.com/tools"

android:id="@+id/activity_main"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

tools:context="com.example.gui.eidttextset.MainActivity">

android:id="@+id/password"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:inputType="textPassword"

android:hint="@string/password_hint"

android:textColorHint="@color/colorPrimary"

android:maxLength="5"

/>

四、运行结果

运行结果:

启动页:web

输入字符以点显示,而且最多只能输入5个字符svg

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值