//适配器布局xml <?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="wrap_content" > <CheckBox android:id="@+id/cb_chose" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10dp" /> <ImageView android:id="@+id/iv_showIcon" android:layout_width="80dp" android:layout_height="80dp" android:src="@mipmap/ic_launcher" android:layout_marginLeft="50dp" /> <TextView android:id="@+id/tv_showInfo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="xxx" android:textSize="20sp" android:layout_marginTop="10dp" android:layout_marginLeft="140dp" /> <TextView android:id="@+id/tv_price" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="xxx" android:layout_marginLeft="140dp" android:layout_marginTop="100dp" android:textColor="#ff00" /> <com.bwei.yuekao_7.ui.weight.ToggleButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_marginTop="100dp" ></com.bwei.yuekao_7.ui.weight.ToggleButton> </RelativeLayout>
//购物车布局
<?xml version="1.0" encoding="utf-8"?> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> <android.support.v7.widget.RecyclerView android:id="@+id/rl_view" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" ></android.support.v7.widget.RecyclerView> <RelativeLayout android:layout_width="match_parent" android:layout_height="50dp" android:gravity="center_vertical" > <CheckBox android:id="@+id/cb_all" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="全选" /> <TextView android:id="@+id/tv_price" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentRight="true" android:gravity="center_vertical" android:text="结算" android:layout_marginLeft="10dp" /> <TextView android:id="@+id/tv_count" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginRight="20dp" android:layout_toLeftOf="@+id/tv_price" android:gravity="center_vertical" android:text="总计" /> </RelativeLayout> </LinearLayout>