3

我想使用一个GridView只会扩大它的高度来显示它的所有孩子。这样做的原因是我想在 上方放置一个自定义视图GridView,它应该与 一起滚动GridView

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <com.myapp.myview
            android:id="@+id/myview"
            android:layout_width="match_parent"
            android:layout_height="50dp" />

        <GridView
            android:id="@+id/gv"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:horizontalSpacing="@dimen/spacing_small"
            android:numColumns="2"
            android:padding="@dimen/spacing_small"
            android:verticalSpacing="@dimen/spacing_small" />
    </LinearLayout>

</ScrollView>

我怎样才能做到这一点?

4

1 回答 1

0

我已经创建了自己的View,将孩子们放在自定义表中。

于 2013-01-06T20:58:43.260 回答