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

  • 相关阅读:
    C#中递归算法的总结
    C# 创建错误日志
    获取指定路径下所有PDF文件的总页数
    C# 将文件转为字符串和将字符串转为文件的方法
    如何获得应用程序的物理路径
    C#中获得文件夹下所有文件的两种方法
    C#中加密与解密
    MacOS系统使用Homebrew官方地址报错
    privoxy代理服务器配置
    Nginx 反向代理 502 permission denied 解决
  • 原文地址:https://www.cnblogs.com/wangjinshabi250/p/6866713.html
Copyright © 2011-2022 走看看