-1

在我的 android 中,我有列表,每个列表项将显示三个 GridView。一个 GridView 显示所有项目及其详细信息,第二个将显示有关该列表的一些操作,然后第三个将显示注销操作。

是否可以实施?如果是,请为我提供实施的最佳方式....

4

1 回答 1

0

如果您想在 ListView 中添加网格,您可以更喜欢 GridLayout 而不是网格视图。通过以下 xml 代码自定义您的列表视图项。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/whole_row"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >
    <GridLayout
        android:id="@+id/one"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:columnCount="3"
        android:orientation="horizontal"
>    </GridLayout>
 <GridLayout
        android:id="@+id/two"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:columnCount="3"
        android:orientation="horizontal"
>    </GridLayout>
 <GridLayout
        android:id="@+id/three"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:columnCount="3"
        android:orientation="horizontal"
>    </GridLayout>
</LinearLayout>
于 2012-09-28T11:32:41.897 回答