• 基本控件的使用


    2.Activity常用 的方法
    View findViewById(int id) 根据组件的ID取得组件对象
    setContentView(int layoutResID) 设置布局文件,设置显示组件
    3.TextVies


    android:maxLength="6" 允许最大字符数
    android:textSize="100px" 文字大小
    android:textStyle="bold" 文字样式
    android:password="true" 是否以密文方法显示
    android:layout_margin="100px" 外边距
    android:background="@id(图片存放的文件夹名)/id(图片名)" 设置id的值
    getText().toString() 获取空间的文本内容
    setText(); 设置控件的文本内容
    注意:<!-- -->注释
    4.Button
    5.EditText
    android:enabled="false" 设置是否可用(false不可用)
    6.RadioButton(单选按钮)
    嵌入到RadioGroup中实现单选效果
    android:checkedButton="radio的id值"
    int getCheckedRadioButtonId();获得被选中的radiobutton的id
    7.ImageView(图片空件)
    android:src 图片资源ID
    android:maxWidth 最大宽度
    android:maxHeight 最大高度
    android:adjustViewBounds 设置为true,则maxWidth和maxHeight生效
    8.ImageButton(图片按钮)
    9.TimePicker(时间控件)
    viod updateDate(int year,int monthOfYear,int dayOfMonth)
    注意:mothOfYear是从0-11表示1-12月
    11.Spinner
    11.1下拉列表项的配置方式
    a.资源文件配置
    第一步:在string.xml配置
    <string-array name="citys">
    list.add("湖南");
    list.add("上海");
    list.add("北京");
    </string-array>
    第二步:指定资源
    android:entries="@arryay/citys";
    b.适配器配置
    第一种:资源配置
    ArrayAdapter<CharSequence> adapter=
    ArrayAdapter.createFromResource(
    this,资源id, 列表显示的样式 );

    第二种:资源配置
    ArrayAdapter<CharSequence> adapte=
    new ArrayAdapter<CharSequence>(
    this,android.R.layout.simple_spinner_item,(列表显示的样式),list(集合数据);

  • 相关阅读:
    element ui表单校验prop的链式写法----源码分析
    函数的链式调用实现Man().sleep().eat()
    chrome浏览器表单自动填充默认样式-autofill
    苹果企业证书签名和超级签名
    iOS企业重签名管理软件之风车签名管理
    iOS/IPA重签名工具
    关于keytool和jarsigner工具签名的使用小结
    《Android逆向反编译代码注入》
    IPA的动态库注入+企业重签名过程
    linux部署MantisBT(二)部署php
  • 原文地址:https://www.cnblogs.com/hewei-666/p/6874636.html
Copyright © 2020-2023  润新知