1.  Button(按钮)

2.EditText(输入框)
属性:
android:selectAllOnFocus //在获得焦点时,会全选文本内容
android:focusable //true表示获得焦点,false不获得焦点(默认获得)
android:enabled //true表示不可编辑,false可以编辑(默认false)

3.RadioButton(单选按钮)
  RadioGroup(单选按钮组)
android:orientation="horizontal" //设置布局方式
android:checkedButton="单选按钮id" //设置默认选中的单选按钮
注意:单选按钮RadioButton,一般需要嵌套在RadioGroup中达到单选的目的
方法:
getCheckedRadioButtonId() //取得选中按钮的RadioButton的ID

4.CheckBox(复选框)
 android:checked="true" //默认选中

5.Spinner(下拉框)

6.Imagrview(图片视图)
android:src="@drawable/资源名称"

7.ImageButton(图片按钮)
android:src="@drawable/资源名称"

8.TimePicker(时间空间)
public Integer getCurrentHour() //返回当前设置的时间
public Integer getCurrentMinute() //返回当前设置的分钟
public boolean inIs24HourView() //判断是否为24小时制
setCurrentHour(Integer CurrentHour)
//判断当前的小时数
setCurrentMinute(Integer CurrentMinute) //设置当前的分钟
setEnabled(boolean enabled) //设置是否可用
setinIs24HourView(Boolean inIs24HourView)//设置时间为24小时制

9.DatePicker(日期空间)
int getYear() //取得设置的年
int getMonth() //取得设置的月
int getDayOfMonth() //取得设置的日
setEnabled(boolean enabled) //设置是否可用
updateDate(int year,int monthOfYear, int darOfMonth) //设置一个指定的日期

10.Spinner(下拉框)

11.两种配置adpate的方式
第一种:资源文件配置
ArrayAdapter.createFromResource(this,资源ID,android.R.layout.simple_spinner_item);
第二种:设置具体值
ArrayAdapter<CharSequence> pcp=new ArrayAdapter<CharSequence>(this,android.R.layout.simple_spinner_item,数据集合);

posted on 2017-05-17 08:34  Talvez  阅读(216)  评论(0编辑  收藏  举报