zoukankan      html  css  js  c++  java
  • mix

    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,数据集合);

  • 相关阅读:
    制作A4纸打印的网页像素大小设置(转)
    关于Vue.use()详解
    Vue的axios如何全局注册
    JS中的apply,call,bind深入理解
    JS异步编程 (2)
    JS异步编程 (1)
    彻底搞清楚javascript中的require、import和export(js模块加载规范的前世今生)
    IPv6地址分类及表示方法
    SublimeText3追踪函数工具CTags设置及使用
    转-编写CGI小结
  • 原文地址:https://www.cnblogs.com/simplest/p/6865684.html
Copyright © 2011-2022 走看看