zoukankan      html  css  js  c++  java
  • radioButton的简单使用

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context="com.example.homework05.MainActivity" >
    
        <RelativeLayout 
            android:layout_width="fill_parent"
            android:layout_height="50dp">
            <!-- 城市 -->
            <!-- drawableLeft:在文字左边设置图标 -->
            <TextView 
                android:id="@+id/city"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                   android:drawableLeft="@drawable/city"
                   android:text="北京"
                   android:gravity="center"/>
            <!-- 扫一扫 -->
            <!-- android:adjustViewBounds="true" 是否调整自己的边界来保 持所显示图片的长宽比-->
            <ImageView 
                android:id="@+id/image_scan"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:src="@drawable/codescan"
                android:layout_alignParentRight="true"
                android:adjustViewBounds="true"/>
            <!-- 搜索编辑框 -->
            <EditText
                android:id="@+id/edit"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:hint="请输入。。。"
                android:layout_toRightOf="@id/city"
                android:layout_toLeftOf="@id/image_scan"/>
            <!-- 搜索图标-->
            <ImageView 
                android:id="@+id/image_search"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:src="@drawable/home_search_icon"
                android:layout_alignRight="@id/edit"
                android:layout_centerVertical="true"/>
        </RelativeLayout>
        <!-- 右下角的购物车 -->
        <ImageView
            android:id="@+id/image_buy"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:src="@drawable/buy"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"/>
        <!-- 下面的标签选项 -->
        <!--  android:button="@null"不显示单选按钮的圆圈 -->
        <RadioGroup 
            android:id="@+id/group"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_alignParentBottom="true"
            android:layout_toLeftOf="@id/image_buy"
            android:weightSum="4"
            android:orientation="horizontal">
            <RadioButton 
                android:id="@+id/btn_home"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:text="首页"
                android:gravity="center"
                android:button="@null"
                android:checked="true"
                android:drawableTop="@drawable/select_home"
                />
             <RadioButton 
                android:id="@+id/btn_person"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:text="分类"
                android:gravity="center"
                android:button="@null"
                android:drawableTop="@drawable/select_person"
                />
              <RadioButton 
                android:id="@+id/btn_new"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="match_parent"
                android:text="新品"
                android:gravity="center"
                android:button="@null"
                android:drawableTop="@drawable/select_new"
                />
               <RadioButton 
                android:id="@+id/btn_search"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="match_parent"
                android:text="搜索"
                android:gravity="center"
                android:button="@null"
                android:drawableTop="@drawable/select_search"
                />
        </RadioGroup>
        
    </RelativeLayout>

  • 相关阅读:
    关于2021-01-13爆发的incaseformat病毒相关信息收集1.2(持续更新和关注中...)
    (转)服务器UDIMM、LRDIMM、RDIMM三种内存的区别
    Shred命令 学习
    关于图片文件的元数据信息清理和时间戳修改
    关于Chrome 浏览器 “小尾巴”问题的解决办法
    CF471D MUH and Cube Walls -kmp
    UVA12467 Secret Word -kmp
    UVA12604 Caesar Cipher -kmp
    【JLOI2007】周期串
    Http协议
  • 原文地址:https://www.cnblogs.com/fangg/p/5564991.html
Copyright © 2011-2022 走看看