EditText继承关系:View-->TextView-->EditText。
EditText的属性很多,这里介绍几个:
android:layout_gravity="center_vertical"
设置控件显示的位置:默认top,这里居中显示,还有bottom
android:hint="请输入数字!"
设置显示在空间上的提示信息
android:numeric="integer"
设置只能输入整数,如果是小数则是:decimal
android:singleLine="true"
设置单行输入,一旦设置为true,则文字不会自动换行。
android:password="true"
设置只能输入密码
android:textColor = "#ff8c00"
字体颜色
android:textStyle="bold"
字体,bold, italic, bolditalic
android:textSize="20dip"
大小
android:capitalize = "characters"
以大写字母写
android:textAlign="center"
EditText没有这个属性,但TextView有,居中
android:textColorHighlight="#cccccc"
被选中文字的底色,默认为蓝色
android:textColorHint="#ffff00"
设置提示信息文字的颜色,默认为灰色
android:textScaleX="1.5"
控制字与字之间的间距
android:typeface="monospace"
字型,normal, sans, serif, monospace
android:background="@null"
空间背景,这里没有,指透明
android:layout_weight="1"
权重,控制控件之间的地位,在控制控件显示的大小时蛮有用的。
android:textAppearance="?android:attr/textAppearanceLargeInverse"

更多相关文章

  1. android事件处理
  2. android 布局
  3. TabHost 相关解决
  4. android 外挂字幕接口
  5. Android使用Dialog实现贴键盘输入框(类似微博评论)
  6. Android中使用WebView, WebChromeClient和WebViewClient加载网页
  7. android中分割线的实现
  8. Android监听软键盘的方式
  9. Widget-进度条

随机推荐

  1. 深度学习技术在美图个性化推荐的应用实践
  2. Django链接mysql数据库
  3. Linux之常用基础命令简介
  4. 0319作业-常用html元素(上)
  5. CSS:flex布局理解及实例演示flex容器中的
  6. 0319作业-常用html元素(下)
  7. ESXi主机网卡识别为10Mb导致业务缓慢
  8. ModuleNotFoundError: No module named '
  9. 2021-03-29:无序数组arr,子数组-1和1的数量
  10. HBase神器 | BDS-HBase集群之间数据迁移