2015.6.25 Textfield汇总

allowBlank:是否允许为空,默认true

blankText :空验证失败后的显示

emptyText:未输入时显示信息

grow :字段是否自动伸展收缩 ,默认false

growMin/Max:收缩的最小/最大宽度

inputType :输入字段类型,默认为Text

maskRe:用于过滤不匹配字符输入的正则表达式?//这个不懂

maxLeng:字段允许输入的最大长度

maxLengthText:最大字符长度验证失败后显示的提示信息

http://tsyouaschen.iteye.com/blog/600255//且做备用

 disabled:false,//默认是false
 fieldLabel:框名
height:"auto",//高度 auto表示auto
 hidden:false,//隐藏
  hideLabel:false,//隐藏标签名
 hideMode:"offsets",//默认display,可以取值:display,offsets,visibility组件的隐藏方式
 readOnly:false,//内容是否只读,默认false
 regex:/^\d$/, //正则表达式 这里假设只允许输入数字 如果输入的不是数字 就会出现下面定义的提示信息
  regexText:"regexText:只能够输入数字", //定义不符合正则表达式的提示信息
  value:"",//自定义的信息 默认是:undefined            
  renderTo://渲染

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
优化此布局<com.google.android.material.textfield.TextInputLayout android:id="@+id/usernameLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="24dp" android:hint="用户名" layout_height="" layout_width="" xmlns:android="http://schemas.android.com/apk/res/android"> <com.google.android.material.textfield.TextInputEditText android:id="@+id/usernameEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="text" android:maxLines="1" /> <com.google.android.material.textfield.TextInputLayout android:id="@+id/passwordLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" android:hint="密码"> <com.google.android.material.textfield.TextInputEditText android:id="@+id/passwordEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPassword" android:maxLines="1" /> <com.google.android.material.textfield.TextInputLayout android:id="@+id/phoneLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" android:hint="密码"> <com.google.android.material.textfield.TextInputEditText android:id="@+id/phoneEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPassword" android:maxLines="1" /> </com.google.android.material.textfield.TextInputLayout> <Button android:id="@+id/registerButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" android:text="注册" /> </com.google.android.material.textfield.TextInputLayout>
最新发布
05-28

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值