基本控件的使用

基本控件的使用

 

1.Activity的常用方法
  View findViewById(int id)         //根据组件的ID取得组件对象
  setContentView(int layoutResID)     //设置布局文件,设置显示组件


2.TextView控件
  android:maxLength="6"          //允许最大值
  android:textColor="#ff0000"         //文件颜色
  android:textSize="50px"         //文字大小
  android:textStyle="bold"        //文字样式
  android:passwprd="true"         //是否以密文方式显示
  android:layout_margin="100px"    //外边距
  android:background="@drawable/a"     //背景
  android:id="@+id/id值"                         //设置ID的值

  getText().toString()           //获得控件的文本内容
  setText();                //设置控件的文本内容


3.EditText
android:enabled = "false"         //设置是否可用,false不能用

注意:<!--xx-->注释

原文地址:https://www.cnblogs.com/dahaoheshan/p/6863738.html