阅读更多

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. MaterialDesign系列文章(六)沉浸式状态栏的使用
  2. Android通过selector改变界面状态
  3. Android(安卓)应用语言设置的实现
  4. Android(安卓)字体自适应设置
  5. 如何让Android字体自适应屏幕分辨率
  6. 管理Android通信录
  7. EditText所有属性详解
  8. Android(安卓)中 PopupWindow的用法 汇总
  9. Android底部导航 BottomNavigationBar(Google官方)

随机推荐

  1. android 之 菜单
  2. android 定时器的实现
  3. android --相机使用详解概述
  4. Android工程打包
  5. 2011.07.01——— android GridView 长按
  6. Android(安卓)Studio开发(二)使用RecyclerV
  7. Android(安卓)Studio(十二):打包多个发布
  8. android 让5556和5554发发sms
  9. (一百八十九)Android(安卓)Jetpack 学习(三)
  10. android 安装卸载程序