• Android第六周作业


    商城系统

    MainActivity.java

    <?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="match_parent"
        android:padding="16dp">
            <ImageView
                android:id="@+id/iv"
                android:layout_width="120dp"
                android:layout_height="90dp"
                android:layout_centerVertical="true" ></ImageView>
            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_toRightOf="@+id/iv"
                android:layout_centerVertical="true">
                <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="桌子"
                android:textSize="20sp"
                android:textColor="#000000"></TextView>
                <TextView
                android:id="@+id/tv_price"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="价格:"
                android:textSize="20sp"
                android:layout_marginTop="10dp"
                android:layout_below="@+id/title"
                android:textColor="#FFEF03"></TextView>
                <TextView
                android:id="@+id/price"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="1000"
                android:textSize="20sp"
                android:layout_below="@+id/title"
                android:layout_toRightOf="@+id/tv_price"
                android:textColor="#FF8F03"
                android:layout_marginTop="10dp"></TextView>
            </RelativeLayout>
    </RelativeLayout>

    activity_main.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="match_parent"
        android:padding="16dp">
            <ImageView
                android:id="@+id/iv"
                android:layout_width="120dp"
                android:layout_height="90dp"
                android:layout_centerVertical="true" ></ImageView>
            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_toRightOf="@+id/iv"
                android:layout_centerVertical="true">
                <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="桌子"
                android:textSize="20sp"
                android:textColor="#000000"></TextView>
                <TextView
                android:id="@+id/tv_price"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="价格:"
                android:textSize="20sp"
                android:layout_marginTop="10dp"
                android:layout_below="@+id/title"
                android:textColor="#FFEF03"></TextView>
                <TextView
                android:id="@+id/price"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="1000"
                android:textSize="20sp"
                android:layout_below="@+id/title"
                android:layout_toRightOf="@+id/tv_price"
                android:textColor="#FF8F03"
                android:layout_marginTop="10dp"></TextView>
            </RelativeLayout>
    </RelativeLayout>

    layout.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="match_parent"
        android:padding="16dp">
            <ImageView
                android:id="@+id/iv"
                android:layout_width="120dp"
                android:layout_height="90dp"
                android:layout_centerVertical="true" ></ImageView>
            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_toRightOf="@+id/iv"
                android:layout_centerVertical="true">
                <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="桌子"
                android:textSize="20sp"
                android:textColor="#000000"></TextView>
                <TextView
                android:id="@+id/tv_price"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="价格:"
                android:textSize="20sp"
                android:layout_marginTop="10dp"
                android:layout_below="@+id/title"
                android:textColor="#FFEF03"></TextView>
                <TextView
                android:id="@+id/price"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="1000"
                android:textSize="20sp"
                android:layout_below="@+id/title"
                android:layout_toRightOf="@+id/tv_price"
                android:textColor="#FF8F03"
                android:layout_marginTop="10dp"></TextView>
            </RelativeLayout>
    </RelativeLayout>
  • 相关阅读:
    寒假自学1.18
    寒假自学笔记1.17
    寒假自学1.16
    寒假自学1.15
    寒假自学1.14
    寒假自学1.13
    寒假自学1.12
    CSS position 属性
    node 获取客户端请求 服务器响应客户端 页面显示客户端想要的格式
    使用 npm 安 装node_modules 总是提示报错
  • 原文地址:https://www.cnblogs.com/hyonf/p/14017633.html
Copyright © 2020-2023  润新知