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

  • 相关阅读:
    mysql索引创建&查看&删除
    linq中不能准确按拼音排序
    Vue的组件的注册,复用以及组件中template多行处理
    Vue的简单使用和部分常用指令
    SpringBootMVC+thymeleaf模板初探
    记一次遗留代码的重构改造:数十万行国家标准坐标文件分析方法的改造与提速
    springBoot 集成Mysql数据库
    C#和Java的对比
    架构学习提炼笔记(三):高性能架构设计技巧——读写分离
    架构学习提炼笔记(二):架构设计的流程是什么?
  • 原文地址:https://www.cnblogs.com/wangjinshabi250/p/6866713.html
Copyright © 2011-2022 走看看