【发布时间】:2013-09-04 07:48:23
【问题描述】:
我想设置列表视图以显示所有项目而不滚动。
下面是我的布局:
<LinearLayout
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/tv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Large Text"
android:textColor="@android:color/black"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
<TextView
android:id="@+id/tv2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Large Text"
android:textColor="@android:color/black"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
线性布局属于滚动视图。
所以我想设置列表视图的所有项目并按父级的滚动滚动。
我该怎么做?
【问题讨论】:
-
滚动视图中的列表视图?
-
这是不可能完成的任务。使用其他替代方法来显示固定数据。
-
@PankajKumar 这不是不可能完成的任务,但大多数情况下这是不好的做法,请看下面我的回答