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

  • 相关阅读:
    深圳移动 神州行(大众卡/轻松卡/幸福卡)套餐资费(含香港日套餐)信息及使用方法
    PHP设置时区,记录日志文件的方法
    微信公众平台消息接口使用指南
    C#日期时间格式化
    使用CMD实现批量重命名[转]
    Python高效编程技巧
    实用WordPress后台MySQL操作命令
    ubuntu-wine
    Javascript 笔记与总结(2-8)对象2
    Swift5.3 语言指南(十) 枚举
  • 原文地址:https://www.cnblogs.com/wangjinshabi250/p/6866713.html
Copyright © 2011-2022 走看看