nestedScrollView с двумя детьми без прокрутки - PullRequest
0 голосов
/ 02 апреля 2020

Я пытаюсь решить эту проблему в течение всего дня, у меня есть nestedScrollView с двумя дочерними элементами: Gridview расположен ниже Относительного макета, когда я прокручиваю вниз относительное расположение, все еще фиксированное, но GridView прокручивается, но я хочу, чтобы оба ребенка прокрутили вниз как если бы это был один просмотр списка.

вот мой код для nestedScrollView:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/tan_background">


    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="4dp"
        android:fillViewport="true">

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

            <include
                android:id="@+id/firstListItem"
                layout="@layout/mlist_item"
                android:nestedScrollingEnabled="true" />

            <GridView
                android:id="@+id/Grid"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:background="@color/tan_background"
                android:divider="@color/tan_background"
                android:dividerHeight="8dp"
                android:drawSelectorOnTop="true"
                android:focusable="true"
                android:horizontalSpacing="5dp"
                android:nestedScrollingEnabled="true"
                android:numColumns="auto_fit"
                android:orientation="vertical"
                android:verticalSpacing="5dp" />
        </LinearLayout>
    </android.support.v4.widget.NestedScrollView>

</RelativeLayout>
...