【发布时间】:2018-01-07 17:14:57
【问题描述】:
我需要一个 Gridview 高于另一个 GridView。
借助这个:how to set Multiple gridview in same layout in android?
我可以在一个布局中设置两个 Gridview。 我在 SwipeRefreshLayout 中都需要它们!
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:baselineAligned="false">
<GridView
android:id="@+id/GridView1"
android:layout_width="465dp"
android:layout_height="101dp"
android:layout_marginBottom="100dp"
android:layout_weight="1"
android:numColumns="1"
android:padding="1dp" />
<GridView
android:id="@+id/GridView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:layout_weight="1"
android:footerDividersEnabled="false"
android:numColumns="3"
android:padding="1dp" />
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
但是它们彼此相邻,我无法将其中一个设置为另一个。 您可以在图片中看到我的问题。
如果你知道如何把一个放在另一个上面,以便两个都填满宽度,请帮帮我。
【问题讨论】:
标签: android xml gridview android-linearlayout swiperefreshlayout