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. 安卓开发36:layout对齐属性总结
  3. (转)Android AndroidManifest.xml文件的android:supportsRtl属性详
  4. Android评分控件RatingBar使用实例解析
  5. Android布局属性介绍
  6. 简解selector的几个属性
  7. android一些有用的View属性

随机推荐

  1. Android优秀开源项目[持续更新~欢迎推荐~
  2. AAC 系列一】Android 应用架构新时代来临
  3. android Home事件汇总
  4. Sensor传感器源码的阅读与应用开发简单实
  5. Android的三种监听方式
  6. Android Location的使用!!
  7. React-Native 项目打包(iOS/Android)
  8. Android数据解析-----解析json数据
  9. Android 简单实现贪吃蛇源码
  10. Android之ViewPager与Fragment