京东简单布局

//详情页面

<?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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值