как использовать макет обновления смахивания во вложенном представлении прокрутки - PullRequest
0 голосов
/ 04 декабря 2018

Я хочу использовать SwipeRefreshLayout внутри NestedScrollView

Вот мой код

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

        <LinearLayout
            android:id="@+id/suggestion_for_follow_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <com.vistaapp.marcopolo.Custom.Views.SquareImageView
                android:id="@+id/img_hide_suggestion_for_follow_layout"
                android:layout_width="@dimen/_12size"
                android:layout_height="0dp"
                android:layout_gravity="right|top"
                android:layout_margin="@dimen/_8margin"
                app:srcCompat="@drawable/ic_cancel"/>

            <android.support.v7.widget.RecyclerView
                android:id="@+id/recycler_suggestion_for_follow"
                android:layout_marginTop="@dimen/_8margin"
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

            <View
                android:layout_marginTop="@dimen/_4margin"
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="@color/gray"/>

        </LinearLayout>

        <android.support.v4.widget.SwipeRefreshLayout
            android:layout_marginTop="@dimen/_4margin"
            android:id="@+id/homeSwipe"
            android:visibility="visible"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <android.support.v7.widget.RecyclerView
                android:id="@+id/homeRecycler"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

        </android.support.v4.widget.SwipeRefreshLayout>

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>

Проблема в SwipeRefreshLayout и RecyclerView в нем не отображается.Но когда я заменяю SwipeRefreshLayout на RecyclerView, все работает нормально.

Как я могу это исправить?

...