我是靠谱客的博主 害怕咖啡,这篇文章主要介绍EditText设置输入的类型,比如说限制只能输入字母和数字,现在分享给大家,希望可以做个参考。


<com.cplotus.app.widget.EditTextWithDel
android:id="@+id/et_password"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="请输入密码"
android:textSize="@dimen/text_size_medium"
android:background="@android:color/transparent"
android:layout_marginLeft="80dp"
android:layout_marginRight="10dp"
android:inputType="textPassword"
android:digits="0123456789qwertyuioplkjhgfdsazxcvbnm"
android:lines="1"
android:maxLength="11"
android:gravity="center_vertical"
/>

注意其中的android:digits="0123456789qwertyuioplkjhgfdsazxcvbnm"
这个就是限制输入类型的。

最后

以上就是害怕咖啡最近收集整理的关于EditText设置输入的类型,比如说限制只能输入字母和数字的全部内容,更多相关EditText设置输入内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(173)

评论列表共有 0 条评论

立即
投稿
返回
顶部