<LinearLayout 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" android:orientation="vertical" > <LinearLayout android:id="@+id/top_bar" android:layout_width="match_parent" android:layout_height="50dp" android:background="#ffffff" android:orientation="horizontal"> <!-- 尖括号的布局 --> <ImageView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:padding="8dp" android:src="@drawable/topbar_up" /> <!-- 购物车的布局 --> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="5.49" android:gravity="center" android:text="购物车" android:textColor="#000000" android:textSize="20sp"/> <!-- 编辑的布局 --> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="3.18" android:gravity="center" android:text="编辑" android:textColor="#000000" android:textSize="20sp" /> </LinearLayout> <ListView android:id="@+id/listview" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:childIndicator="@null" android:groupIndicator="@null" > </ListView> <LinearLayout android:layout_width="match_parent" android:layout_height="50dp" android:orientation="horizontal" > <LinearLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="2.5" android:gravity="center_vertical" android:orientation="horizontal" > <CheckBox android:id="@+id/all_chekbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginLeft="10dp" android:layout_marginRight="4dp" android:button="@drawable/check_box_bg" android:checkMark="?android:attr/listChoiceIndicatorMultiple" android:gravity="center" android:minHeight="64dp" android:paddingLeft="10dp" android:textAppearance="?android:attr/textAppearanceLarge" android:visibility="visible" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:text="合计:" android:textSize="16sp" android:textStyle="bold" /> <TextView android:id="@+id/tv_total_price" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="¥0.00" android:textColor="@color/purple" android:textSize="16sp" android:textStyle="bold" /> </LinearLayout> <TextView android:id="@+id/tv_delete" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="@color/orange" android:clickable="true" android:gravity="center" android:text="删除" android:textColor="#FAFAFA" /> <TextView android:id="@+id/tv_go_to_pay" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#E24146" android:clickable="true" android:gravity="center" android:text="付款(0)" android:textColor="#FAFAFA" /> </LinearLayout> </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="wrap_content" android:orientation="vertical" > <View android:layout_width="match_parent" android:layout_height="1dp" android:background="#CCCCCC" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/page_backgroup" android:orientation="horizontal" > <CheckBox android:id="@+id/check_box" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginLeft="10dp" android:layout_marginRight="4dp" android:button="@drawable/check_box_bg" android:checkMark="?android:attr/listChoiceIndicatorMultiple" android:gravity="center" android:minHeight="64dp" android:minWidth="32dp" android:textAppearance="?android:attr/textAppearanceLarge" android:visibility="visible" /> <ImageView android:id="@+id/iv_adapter_list_pic" android:layout_width="85dp" android:layout_height="85dp" android:layout_marginBottom="15dp" android:layout_marginTop="13dp" android:scaleType="centerCrop" android:src="@mipmap/xibeihongti" /> <RelativeLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_marginTop="10dp" android:layout_marginLeft="13dp" > <TextView android:id="@+id/tv_goods_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="10dp" android:layout_marginTop="20dp" android:ellipsize="end" android:maxLines="2" android:textColor="@color/grey_color1" android:textSize="14sp" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_marginBottom="30dp" android:orientation="horizontal" > <TextView android:id="@+id/tv_goods_price" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:singleLine="true" android:textColor="@color/orange_color" android:textSize="14sp" android:textStyle="bold" /> <TextView android:id="@+id/tv_type_size" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="10dp" android:layout_toRightOf="@+id/tv_goods_price" android:singleLine="true" android:textColor="@color/grey_color3" android:textSize="10sp"/> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="15dp" android:orientation="horizontal" > <TextView android:id="@+id/tv_reduce" android:layout_width="25dp" android:layout_height="25dp" android:background="@drawable/text_angle_gray" android:gravity="center" android:text="一" android:textColor="@color/grey_color1" android:textSize="12sp" /> <TextView android:id="@+id/tv_num" android:layout_width="25dp" android:layout_height="25dp" android:background="@drawable/text_angle" android:gravity="center" android:singleLine="true" android:text="1" android:textColor="@color/grey_color1" android:textSize="12sp" /> <TextView android:id="@+id/tv_add" android:layout_width="25dp" android:layout_height="25dp" android:background="@drawable/text_angle_right" android:gravity="center" android:text="+" android:textColor="@color/grey_color1" android:textSize="12sp" /> </LinearLayout> </RelativeLayout> </RelativeLayout> </LinearLayout> </LinearLayout>
仿淘宝购物车的实现
最新推荐文章于 2023-05-24 10:23:53 发布
本文介绍了一种典型的购物车界面布局设计方案,包括顶部导航栏、商品列表和底部操作栏等部分。顶部导航栏包含返回按钮、页面标题和编辑按钮;商品列表展示了商品图片、名称、价格及数量调整选项;底部操作栏提供全选、合计金额显示及结算和删除功能。
2129

被折叠的 条评论
为什么被折叠?



