1

我有一个显示列表视图的 android 应用程序,其中显示:

但我想以以下格式显示:

一二

三四

我该怎么办?</p>

4

2 回答 2

1

GridView是您问题的解决方案。按照本教程

于 2012-12-22T13:37:43.333 回答
0

首先,您应该维护一个单独的 xml 文件以在 Android的列表视图中显示任何类型的输出。

对于多列列表视图,xml 文件将是

 <?xml version="1.0" encoding="utf-8"?>
 <!-- row.xml -->
 <LinearLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:paddingTop="4dip"
 android:paddingBottom="6dip"
 android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:orientation="horizontal">

 <TextView android:id="@+id/TRAIN_CELL"
     android:layout_width="50dip"
     android:layout_height="wrap_content"/>

 <TextView android:id="@+id/TO_CELL"
     android:layout_width="60dip"
     android:layout_height="wrap_content"  android:layout_weight="1"/>
</LinearLayout>

是您正在寻找的示例。对于实现多列列表视图的完整教程,您可以查看

祝你好运

于 2012-07-16T03:20:42.350 回答