商品付き生放送のソースコード、通常のショッピングモールのショッピングページの制作

商品を含むライブブロードキャストのソースコード、一般モールのショッピングページの作成と実装に関連するコード
res / layoutファイルに、TextViewコントロールを配置してショッピングモールインターフェイスのタイトルを表示し、ListViewを配置します。ショッピングモールインターフェースのリストを表示するためのコントロール

<?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"
    tools:context=".MainActivity"
    android:orientation="vertical">
 
    <TextView
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:text="购物商城"
        android:textSize="18sp"
        android:textColor="#FFFFFF"
        android:background="#FF8F03"
        android:gravity="center"/>
 
    <ListView
        android:id="@+id/lv"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:listSelector="@color/colorAccent" />
 
</LinearLayout>
list_Item.xml

res / layoutファイルにリストエントリインターフェイスのレイアウトファイルlist_item.xmlを作成し、ファイルにImage Viewコントロールを配置して製品の画像を表示し、2つのTextViewコントロールを配置して製品の名前と価格をそれぞれ表示します。 !!

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

上記は生放送のソースコードであり、総合モールのショッピングページの制作・実装に関連するコードです。詳細については、以下の記事をご覧ください。

おすすめ

転載: blog.csdn.net/yb1314111/article/details/123684657