posts - 296,comments - 1,views - 2995

一.所花时间

0.5h

二.代码量

30行

三.博客量

1篇

四.了解到的知识点

编辑框EditText

编辑框EditText用于接收软键盘输入的文字,例如用户名、密码、评价内容等,它由文本视图派生而
来,除了TextView已有的各种属性和方法,EditText还支持下列XML属性。
inputType:指定输入的文本类型。输入类型的取值说明见表5-4,若同时使用多种文本类型,则可
使用竖线“|”把多种文本类型拼接起来。
maxLength:指定文本允许输入的最大长度。
hint:指定提示文本的内容。
textColorHint:指定提示文本的颜色。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:padding="5dp"
 android:orientation="vertical" >
 <TextView
android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:layout_marginTop="5dp"
 android:text="下面是登录信息"
 android:textColor="@color/black"
 android:textSize="17sp" />
 <EditText
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:inputType="text"
 android:maxLength="10"
 android:hint="请输入用户名"
 android:textColor="@color/black"
 android:textSize="17sp" />
 <EditText
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:inputType="textPassword"
 android:maxLength="8"
 android:hint="请输入密码"
 android:textColor="@color/black"
 android:textSize="17sp" />            
</LinearLayout>

 

posted on   leapss  阅读(6)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示