LinearLayout不会填充scrollview

时间:2012-03-09 14:38:57

标签: android layout android-ui android-gui

<ScrollView android:layout_width="fill_parent" android:id="@+id/scrollView1"
        android:layout_height="fill_parent">
        <LinearLayout android:id="@+id/linearLayout1"
            android:layout_width="fill_parent" android:orientation="vertical"
            android:layout_height="fill_parent">
            <ListView android:id="@+id/listView1" android:layout_width="fill_parent"
                android:layout_height="fill_parent"></ListView>
        </LinearLayout>
    </ScrollView>

滚动视图填满整个屏幕,但linearLayout1只填充屏幕的一小部分,高度接近100dip。如何让linearLayout1填充父级?

2 个答案:

答案 0 :(得分:29)

尝试:

android:fillViewport="true" 
滚动视图

上的

此处提供更多信息:LinearLayout not expanding inside a ScrollView

答案 1 :(得分:0)

您不能在ScrollView中拥有ListView。

相关问题