Android

1.TextView(标签控件) 

1.1常用:      

    android:text          //显示文本内容      

   android:textColor    //文字颜色      

   android:textSize    //字体的大小      

   android:textStyle  //字体样式:bold,italic     

   android: maxLength //允许的最大字符数   

   android:password //是否用密文显示:true,false  

 1.2方法:   

      setText(String);//设置文本内容

      getText().toString();//返回文本内容  

1.3补充属性      

android:layout_width:   组件宽度      

android:layout_height:  组件高度      

android:id+"@+id/id值"   设置控件是我唯一标识      

android:background       设置背景   

注意:        

fill_parent:组件的宽度/高度充满整个屏幕       

 wrap_content:组件的宽度/高度为内容的实际宽度/高度

2.Button(按钮)

3.EditTest(输入框)  

3.1属性:   

     android:enabled                   //文本值无法改变:true不可编辑,false可编辑(默认false)

     android:selectAllOnFocus     //在获得焦点时,会全选文本内容:true,false    

    android:focusable              //true获得焦点,false不获得焦点(默认获得焦点)

4.RadioButton(单选按钮)   

     RadioGroup(单选按钮组)

          android:orientation="horizontal"       //设置布局方式       

          android:checkedButton="@+id/rb2"      //设置默认选中的单选按钮     

注意:单选按钮RadioButton,一般需要嵌套在RadioGroup中达到单选的目的

方法:    getCheckedRadioButtonId();//获得选中的按钮的id

原文地址:https://www.cnblogs.com/pohuaiwang/p/6840164.html