zoukankan      html  css  js  c++  java
  • Android day02

    6.RadioButton(单选按钮)   

    嵌入到RadioGroup中实现单选效果   

    android:checkedButton="Radio的id值";

      

    int getCheckedRadioButtonId();  //获得被选中的radiobutton的id值

    例:

    <RadioGroup
       android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:checkedButton="@+id/rb2"
     >
        <RadioButton
           android:id="@+id/rb1"
           android:layout_width="fill_parent"
             android:layout_height="wrap_content"
           android:text="王晋是帅哥"
        />
        <RadioButton
           android:id="@+id/rb2" 
           android:layout_width="fill_parent"
            android:layout_height="wrap_content"
           android:text="王晋是傻逼"
        />
     </RadioGroup>

     7.ImageView(图片控件)   

    android:src //图片的资源id   

    android:maxWidth //最大宽度  

    android:maxHeight //最大高度   

    android:adjustViewBounds //设置为true,则macWidth和maxHeight生效

    例:

     <ImageView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:maxWidth="100px"
        android:maxHeight="150px"
        android:adjustViewBounds="true"
        android:src="@drawable/a"
     />

     8.ImageButton(图片按钮)  

    例:

    <CheckBox
       android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:text="lemon"
       android:checked="true"
     />
     <CheckBox
       android:layout_width="fill_parent" 
          android:layout_height="wrap_content"
          android:text="mango"
          android:checked="true"
     />

    9.TimePicker(时间控件)  

    例:

    <TimePicker
      android:id="@+id/tp"
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content"
     />

    10.DatePicker(日期控件)   //修改日期   

    void updateDate(int year,int monthOfYear,int dayOfMonth)   

    注意:monthOfYear是从0-11表示1-12月

    例:

    <DatePicker
        android:id="@+id/dp"
        android:layout_width="fill_parent"
          android:layout_height="wrap_content" 
     />

  • 相关阅读:
    day50——前端简介、标签分类、常用标签
    day46——约束条件、表与表建 关系、修改表的完整语法
    day45——存储引擎、数据类型、约束条件
    day44——存储数据的发展、数据库分类、mysql
    Ⅰ:计算机核心基础
    Ⅶ:基本数据类型及内置方法
    Ⅶ:作业
    Ⅵ:深浅copy
    Ⅵ:流程控制
    Ⅳ:运算符
  • 原文地址:https://www.cnblogs.com/wangjinshabi250/p/6866713.html
Copyright © 2011-2022 走看看