zoukankan      html  css  js  c++  java
  • Android控件的使用

    1. RadioButton (单选按钮)
    嵌入到RadioGroup中实现单选效果
    android:checkedButton="radio的id值"
    int getcheckedRadioButtonid(); //活动被选中的 RadioButton的id

    实咧:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <RadioGroup
    android:id="@+id/sex"
    android:layout_width="400px"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:checkedButton="@+id/male"
    >
    <RadioButton
    android:text="男"
    android:id="@+id/male"
    android:layout_width="60px"
    android:layout_height="wrap_content"
    />
    <RadioButton
    android:text="女"
    android:id="@+id/female"
    android:layout_width="60px"
    android:layout_height="wrap_content"
    />
    </RadioGroup>
    </LinearLayout>

    实现效果:

    2. ImageView (图片控件)
    android :src //图片资源id
    android :maxWidth //最大宽度
    android :maxHeight //最大高度
    android:adjustViewBound //设置true ,则maxWidth和maxHeight生效

    3. ImageButton (图片按钮)
    4. TimePicker (时间控件)
    5. DatePicker (日期)

    // 修改日期
    void updateDate(int year, int monthOfYear, int dayOfMonth)
    注意: monthOFfYear是从0-11表示1-12月

  • 相关阅读:
    关于粒子发射(CAEmitterLayer)
    自定义cell(xib)中button点击事件不能响应的情况
    xcode意外退出
    iOS开发技巧-2
    禁止UIWebView随键盘的弹起而往上滚动
    内联函数
    使用sudo apt-get出现无法解析域名的问题:“cn.archive.ubuntu.com”
    iOS进阶
    swift 中的defer
    iOS中static的作用
  • 原文地址:https://www.cnblogs.com/alhy/p/6866540.html
Copyright © 2011-2022 走看看