day21

首先我们来看下布局文件 

<FrameLayout 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"
    >
    <RelativeLayout
    android:id="@+id/relate_1"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ImageView
        android:id="@+id/buy_detial_image"
        android:layout_width="match_parent"
        android:layout_height="240dp"
        android:scaleType="centerCrop"

        android:src="@mipmap/ic_launcher" />
    <TextView
        android:id="@+id/buy_detial_title"
        android:layout_below="@+id/buy_detial_image"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="16dp"
        android:text="Air Jordan 1 Low Laser Blue 激光蓝 篮球鞋"
        android:textColor="@color/black"
        android:textSize="23sp"
        android:gravity="center"
         />
        <TextView
            android:id="@+id/buy_detial_price"
            android:layout_below="@+id/buy_detial_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="16dp"
            android:text="$699"
            android:textColor="@color/black"
            android:textSize="25sp"
            android:textStyle="bold"
            android:gravity="center"
             />
        <Button
            android:id="@+id/buy_detial_buy"
            android:layout_below="@+id/buy_detial_price"
            android:layout_width="200dp"
            android:layout_height="60dp"
            android:layout_marginTop="220dp"
            android:layout_marginLeft="110dp"
            android:gravity="center"
            android:text="加入购物车"
            android:textSize="25dp"
            android:textColor="@color/white"
            android:background="@drawable/bg_btn"/>
    </RelativeLayout>

</FrameLayout>

原文地址:https://www.cnblogs.com/chenaiiu/p/13557260.html