购物车布局

来源:互联网 发布:fx3u一48编程手册书 编辑:程序博客网 时间:2024/06/16 11:02
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical"    tools:context="com.bwei.www.demo.CarActivity">    <ExpandableListView        android:id="@+id/exlv"        android:layout_width="match_parent"        android:layout_height="match_parent"        android:layout_weight="1"></ExpandableListView>    <RelativeLayout        android:id="@+id/rl"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:background="#ffffff">        <CheckBox            android:id="@+id/checkbox"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_centerVertical="true" />        <TextView            android:id="@+id/qx"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_centerVertical="true"            android:layout_toRightOf="@id/checkbox"            android:text="全选" />        <LinearLayout            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_centerVertical="true"            android:layout_toRightOf="@id/qx"            android:orientation="vertical">            <TextView                android:id="@+id/price"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="总价:0.0" />            <TextView                android:id="@+id/num"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="共0件商品" />        </LinearLayout>        <Button            android:id="@+id/jiesuan"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_alignParentRight="true"            android:background="#ff0000"            android:text="去结算" />    </RelativeLayout></LinearLayout>


一级列表布局

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="horizontal">    <CheckBox        android:id="@+id/che"        android:layout_width="25dp"        android:layout_height="25dp" />    <ImageView        android:layout_width="20dp"        android:layout_height="20dp"        android:layout_marginLeft="20dp"        android:src="@drawable/dianpu" />    <TextView        android:id="@+id/g_title"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_marginLeft="20dp"        android:text="------------" /></LinearLayout>


二级列表布局

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent">    <CheckBox        android:id="@+id/z_che"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_centerVertical="true"        android:layout_marginTop="11dp" />    <LinearLayout        android:id="@+id/linearLayout"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_marginTop="30dp"        android:layout_toRightOf="@id/z_che"        android:orientation="vertical">        <TextView            android:id="@+id/z_title"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:text="三只松鼠大礼包"            android:textStyle="bold" />        <RelativeLayout            android:layout_width="match_parent"            android:layout_height="wrap_content">            <ImageView                android:id="@+id/z_img"                android:layout_width="140dp"                android:layout_height="140dp"                android:src="@mipmap/ic_launcher" />            <TextView                android:id="@+id/z_price"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_alignParentTop="true"                android:layout_toEndOf="@+id/z_img"                android:layout_toRightOf="@+id/z_img"                android:text="价钱"                android:textColor="#ff0000" />            <TextView                android:id="@+id/z_shuxing"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_below="@+id/z_price"                android:layout_toEndOf="@+id/z_img"                android:layout_toRightOf="@+id/z_img"                android:text="价钱" />            <LinearLayout                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_below="@id/z_shuxing"                android:layout_marginTop="10dp"                android:layout_toRightOf="@id/z_img"                android:orientation="horizontal">                <ImageView                    android:id="@+id/iv_jian"                    android:layout_width="20dp"                    android:layout_height="20dp"                    android:src="@drawable/shopcart_minus_red" />                <TextView                    android:id="@+id/tv_num"                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_marginLeft="10dp"                    android:text="1" />                <ImageView                    android:id="@+id/iv_add"                    android:layout_width="20dp"                    android:layout_height="20dp"                    android:layout_marginLeft="5dp"                    android:src="@drawable/shopcart_add_red" />                <ImageView                    android:id="@+id/del"                    android:layout_width="20dp"                    android:layout_height="20dp"                    android:layout_gravity="right"                    android:layout_weight="1"                    android:src="@drawable/rublish" />            </LinearLayout>        </RelativeLayout>    </LinearLayout></RelativeLayout>