zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    安卓代码混淆与反射冲突,地图无法显示等问题解决及反编译方法
    脱掉360奇虎的“加固保”壳后的发现与你的微信安全
    android 发送http请求
    mysql sql优化
    hdu 1548 A strange lift
    【转】vc中使用SendMessage正确发送自定义消息的方法--不错
    【转】各种常用浏览器“兼容性视图”设置方法
    IE 弹出"Unable to do xml/xsl" Processing
    【转】MFC界面更新实现方法
    【转】怎么在Foxmail回复/转发时使用签名?
  • 原文地址:https://www.cnblogs.com/qq1123514689/p/13986072.html
Copyright © 2011-2022 走看看