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" 
     />

  • 相关阅读:
    QQ机器人
    MySQL Hash索引和B-Tree索引的区别
    python format
    Python csv模块的使用
    Python 随机数函数
    关于Python Profilers性能分析器
    数据结构之排序算法Java实现(6)—— 插入类排序之折半插入排序算法
    数据结构之排序算法Java实现(5)—— 插入类排序之直接插入排序算法
    数据结构之排序算法Java实现(4)—— 交换类排序之快速排序算法
    数据结构之排序算法Java实现(3)—— 交换类排序之冒泡排序算法
  • 原文地址:https://www.cnblogs.com/wangjinshabi250/p/6866713.html
Copyright © 2011-2022 走看看