0

ListViewAndroid アプリに があります。アイテムのListViewカタログであるはずです。現在、行リストとして表示されているため、カタログとはあまり似ていません。

3 つの垂直行と、カタログ内のアイテム数と同じ数の水平行を使用して、ある種のテーブル ビューを作成する方法はありますListViewか? また、長方形のセルとしてうまく表示されるようにセルのレイアウトを変更するにはどうすればよいですか?

CellLayout.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/itemNameList"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/itemPriceList"
    android:layout_below="@+id/itemNameList"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"/>

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/itemImageList"
    android:layout_alignParentTop="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true" />

4

1 に答える 1

0

私は非常に簡単な方法でそれを解決しました: のタイプを変更し、セルのレイアウトListViewGridView修正したので、水平ではなく垂直に表示されます。

于 2017-01-09T16:37:37.000 に答える