//详情页面
<?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.gjl.yuekaolianxi.view.MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal"> <TextView android:id="@+id/back" android:layout_width="30dp" android:layout_height="30dp" android:background="@mipmap/ic_launcher"/> <TextView android:id="@+id/main_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:text="商品详情"/> </LinearLayout> <View android:layout_width="match_parent" android:layout_height="0.75dp" android:background="#F00"/> <ImageView android:id="@+id/main_big_pic" android:layout_width="match_parent" android:layout_height="300dp" android:scaleType="centerCrop" android:src="@mipmap/ic_launcher"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical"> <TextView android:id="@+id/main_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="商品名"/> <TextView android:id="@+id/main_price" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="原价"/> <TextView android:id="@+id/main_price2" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="折扣价"/> </LinearLayout> <View android:layout_width="match_parent" android:layout_height="0.75dp" android:background="#F00"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:orientation="horizontal"> <TextView android:id="@+id/main_cart" android:layout_width="0dp" android:layout_height="30dp" android:layout_weight="1" android:clickable="true" android:gravity="center" android:text="购物车"/> <View android:layout_width="0.75dp" android:layout_height="match_parent" android:background="#F00"/> <TextView android:id="@+id/main_add" android:layout_width="0dp" android:layout_height="30dp" android:layout_weight="1" android:clickable="true" android:gravity="center" android:text="加入购物车"/> </LinearLayout> </LinearLayout>//购物车页面
<?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.gjl.yuekaolianxi.view.CartActivity"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:text="购物车" android:textColor="@android:color/black" android:textSize="25sp"/> <View android:layout_width="match_parent" android:layout_height="0.75dp" android:background="#999999"/> <ExpandableListView android:id="@+id/ex_list_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:groupIndicator="@null"></ExpandableListView> <View android:layout_width="match_parent" android:layout_height="0.75dp" android:background="#999999"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <CheckBox android:id="@+id/cart_cb" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="全选/反选" android:textColor="@android:color/black" android:textSize="25sp"/> <TextView android:id="@+id/cart_sum12" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:text="总价:0" android:textColor="@android:color/black" android:textSize="25sp"/> </LinearLayout> </LinearLayout>//1.
<?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="wrap_content" android:gravity="center_vertical" android:orientation="horizontal"> <CheckBox android:id="@+id/parent_cb" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:id="@+id/parent_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="商家" android:textColor="@android:color/black" android:textSize="25sp"/> </LinearLayout>//2.
<?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="wrap_content" android:gravity="center_vertical" android:orientation="horizontal"> <CheckBox android:id="@+id/child_cb" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <ImageView android:id="@+id/child_img" android:layout_width="50dp" android:layout_height="50dp" android:scaleType="centerCrop" android:src="@mipmap/ic_launcher"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/child_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="商品名"/> <TextView android:id="@+id/child_price" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="优惠价" android:textColor="@android:color/holo_red_dark"/> </LinearLayout> </LinearLayout>