【发布时间】:2011-12-11 15:19:53
【问题描述】:
我希望我的整个活动一次滚动,但嵌入在我的 ScrollView 中的 ListView 不会展开。我只看到第一行,但在滚动 listView 时,我可以滚动浏览其他行。 我需要的是让 listView 扩展高度,以便显示它包含的每个项目,而无需滚动 listview,只有主 scrollView...
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:orientation="vertical"
android:layout_weight="1" >
<LinearLayout
android:id="@+id/header_Layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
...
</LinearLayout>
<TextView
android:id="@+id/comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:background="@drawable/gradient_background"
android:text="@string/comments"
android:textColor="#000000"
android:textStyle="bold" >
</TextView>
<ListView
android:id="@+id/commentsListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill"
android:divider="@drawable/gradient_divider"
android:dividerHeight="1dp" />
</LinearLayout>
</ScrollView>
【问题讨论】:
标签: android listview scrollview