【发布时间】:2015-06-29 08:20:16
【问题描述】:
我正在尝试显示列表视图并在页面中向下滚动它们。但是,滚动不会显示所有内容,仅像 30dp 一样滚动,并且要显示更多的列表视图。关于这个有很多问题,但它们不适用于我的代码。如果您能告诉我我在下面的代码中缺少什么,我将不胜感激。谢谢
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/scrollView"
xmlns:android="http://schemas.android.com/apk/res/android"
android:fillViewport="false">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="183dp"
tools:context=".MainActivity"
android:weightSum="1"
android:id="@+id/rel">
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="171dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="0dp"
android:layout_alignParentBottom="true">
</android.support.v4.view.ViewPager>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="479dp"
tools:context=".MainActivity"
android:weightSum="1"
android:id="@+id/rel2"
android:gravity="left|right">
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/listView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignWithParentIfMissing="false" />
</RelativeLayout>
</LinearLayout>
【问题讨论】:
-
不是答案,但要避免在垂直滚动的滚动视图中添加垂直滚动的 Listview
-
还将 LinearLayout 设为 android:layout_height="wrap_content"
标签: android layout scrollview