布局

购物车UI布局设计
本文展示了一个购物车页面的UI布局设计方案,包括商品列表、总价显示及结算按钮等元素,并采用了ScrollView和LinearLayout来确保良好的滚动体验和布局效果。


    <ScrollView
        android:layout_above="@+id/linear_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">


        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">


            <!--购物车的二级列表-->
            <com.dash.a18_shopping_cart.view.custom.CartExpanableListview
                android:id="@+id/expanable_listview"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">


            </com.dash.a18_shopping_cart.view.custom.CartExpanableListview>


            <!--为你推荐-->
            <LinearLayout
                android:orientation="vertical"
                android:background="#00ff00"
                android:layout_width="match_parent"
                android:layout_height="500dp">


            </LinearLayout>






        </LinearLayout>




    </ScrollView>


    <LinearLayout
        android:id="@+id/linear_layout"
        android:layout_alignParentBottom="true"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="50dp">
        <CheckBox
            android:layout_marginLeft="10dp"
            android:button="@null"
            android:background="@drawable/check_box_selector"
            android:id="@+id/check_all"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />


        <TextView
            android:id="@+id/text_total"
            android:text="合计:¥0.00"
            android:layout_weight="2"
            android:layout_width="0dp"
            android:layout_height="wrap_content" />


        <TextView
            android:text="去结算(0)"
            android:background="#ff0000"
            android:textColor="#ffffff"
            android:gravity="center"
            android:id="@+id/text_buy"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="match_parent" />


    </LinearLayout>







    <CheckBox
        android:button="@null"
        android:background="@drawable/check_box_selector"
        android:id="@+id/check_group"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />


    <TextView
        android:layout_marginLeft="10dp"
        android:text="京东自营"
        android:id="@+id/text_group"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />














 <CheckBox
        android:layout_centerVertical="true"
        android:id="@+id/check_child"
        android:button="@null"
        android:background="@drawable/check_box_selector"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />


    <ImageView
        android:id="@+id/image_good"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@+id/check_child"
        android:layout_marginLeft="10dp"
        android:layout_width="80dp"
        android:layout_height="80dp" />


    <TextView
        android:id="@+id/text_title"
        android:layout_toRightOf="@+id/image_good"
        android:layout_marginLeft="10dp"
        android:layout_alignTop="@+id/image_good"
        android:maxLines="2"
        android:minLines="2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />


    <TextView
        android:id="@+id/text_price"
        android:layout_toRightOf="@+id/image_good"
        android:layout_marginLeft="10dp"
        android:layout_alignBottom="@+id/image_good"
        android:text="¥99.99"
        android:textColor="#ff0000"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />


    <LinearLayout
        android:layout_alignParentRight="true"
        android:layout_alignBottom="@+id/image_good"
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">


        <TextView
            android:id="@+id/text_jian"
            android:text="一"
            android:padding="5dp"
            android:background="@drawable/bian_kuang_line"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />


        <TextView
            android:gravity="center"
            android:id="@+id/text_num"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:background="@drawable/bian_kuang_line"
            android:layout_width="wrap_content"
            android:layout_height="match_parent" />


        <TextView
            android:id="@+id/text_add"
            android:text="十"
            android:padding="5dp"
            android:background="@drawable/bian_kuang_line"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />


    </LinearLayout>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值