android第二章控件2

Button (按钮)

EditText(编辑框)

                android: password=””                                     //是否以密文方式显示

            android: numeric=”integer”                           //只能输入数字

            android: hint=”**”                                                      //水印

            android: enabled=”false”                               //设置是否可用,false不能用

RadioButton(单选按钮)

            嵌入到RadioGroup中实现单选效果

                android: checkedButton=”radio的id值 ”;

            int getCheckedRadioButtonId( );                    //获得被选中的单选按钮的id

CheckBox(复选框)

                android: checked=”true”;                               //设置默认选中

                CheckBox(Context context)                            //实例化CheckBox组件

            void setChecked(boolean checked)     //设置默认选中

ImageView(图片控件)

            android: maxHeight=” ”;                                //图片的最大高度

            android: maxWidth=” ”;                                 //图片的最大宽度

            android: src=” ”;                                                         //图片的资源ID

            android: adjustViewBounds=” ”;         //设置为true,则maxHeight和maxWidth

ImageButton(图片按钮)

TimePicker(时间选择器)

方法

描述

Integer getCurrentHour ()

返回当前设置的小时

Integer getCurrentMinute()

返回当前设置的分钟

boolean is24HourView()

判断是否是24小时制

void setCurrentHour(Integer currentHour)

设置当前的小时数

void setCurrentMinute(Integer currentMinute)

设置当前的分钟

void setEnabled(boolean enabled)

设置是否可用

void set24HourView(Boolean id24HourView)

设置时间为24小时制

DatePicker(日期选择器)

方法

描述

Int   getYear ()

取得设置的年

Int   getMonth()

取得设置的月

int   getDayOfMonth()

取得设置的日

void   setEnabled(boolean enabled)

设置是否可用

原文地址:https://www.cnblogs.com/22joke/p/6866729.html