zoukankan      html  css  js  c++  java
  • Activity的常用控件

     

    TimerPick(时间控件)
    public Integer getCurrentHour() //返回当前设置的小时
    public Integer getCurrentMinute()//返回当前设置的分钟
    public boolean is24HourView() //判断是否是24小时制
    setCurrentHour(Integer currentHour) //设置当前的小时数
    setCurrentMinute(Integer currentMinute) //设置当前的分钟
    setEnabled(boolean enabled) //设置是否可用
    setIs24HourView(Boolean is24HourView) //设置时间为24小时制


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


    Spinner(下拉框)
    public CharSequence getPrompt () //取得提示文字
    public void setPrompt (CharSequence prompt)//设置组件的提示文字
    public void setAdapter (SpinnerAdapter adapter)//设置下拉列表项


    EditText属性(输入框)

    android:selectAllOnFocus //在获取焦点时,会全选文本内容
    android:focusable //true表示获取焦点 false表示不获取焦点
    android:enabled //true表示可编辑,false表示不可编辑


    RadioButton(单选按钮)
    android:orietation="horizontal" //设置布局方式
    android:checkedButton="单选按钮id" //设置默认选中的单选按钮
    PS:单选按钮Radiobutton,一般需要嵌套在RadioGroup中达到单选的目的。
    方法: getCheckedRadioButtonId();//获得选中的按钮的id

  • 相关阅读:
    【队列】队列的分类和实现
    【JSP】EL表达式语言
    【JSP】JSP的介绍和基本原理
    【JSP】JSP Action动作标签
    【Servlet】关于RequestDispatcher的原理
    【JSP】JSP指令
    【JSP】JSP中的Java脚本
    【算法】表达式求值--逆波兰算法介绍
    C语言指针详解
    移动架构-MVVM框架
  • 原文地址:https://www.cnblogs.com/shuchongzeishuai/p/6868777.html
Copyright © 2011-2022 走看看