4

I want to use SwipeRefreshLayout inside NestedScrollView

Here is my code

<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>

The problem is SwipeRefreshLayout and RecyclerView in it doesn't show. But when I replace SwipeRefreshLayout with RecyclerView works fine.

How can I fix that?

omid naghipoor
  • 178
  • 1
  • 2
  • 12
  • Possible duplicate of [SwipeRefreshLayout with scrollView and Layout above](https://stackoverflow.com/questions/25294395/swiperefreshlayout-with-scrollview-and-layout-above) – Aditya Dec 04 '18 at 12:47
  • I don't use ScrollView in SwipeRefreshLayout. I'm using SwipeRefreshLayout in ScrollView. – omid naghipoor Dec 04 '18 at 14:14

0 Answers0