Skip to main content

I'm trying to implement a layout which contains RecyclerViewRecyclerView and ScrollViewScrollView at the same layout.

Layout template:

<RelativeLayout> <ScrollView android:id="@+id/myScrollView">   <unrelated data>...</unrealated data>   <android.support.v7.widget.RecyclerView   android:layout_width="match_parent"   android:layout_height="wrap_content"   android:id="@+id/my_recycler_view"  /> </ScrollView>    </RelativeLayout> 

Problems: iI can scroll until the last element of ScrollView.

Things iI tried:

  1. cardCard view inside the ScrollView (now ScrollView contains RecyclerView) - can see the card up until the RecyclerView.
  2. initialInitial thought was to implement this viewGroupViewGroup using RecyclerView instead of ScrollView where one of it's views type is the CardView, but iI got the exact same results as with the ScrollView.

I'm trying to implement a layout which contains RecyclerView and ScrollView at the same layout.

Layout template:

<RelativeLayout> <ScrollView android:id="@+id/myScrollView"> <unrelated data>...</unrealated data>   <android.support.v7.widget.RecyclerView   android:layout_width="match_parent"   android:layout_height="wrap_content"   android:id="@+id/my_recycler_view"  /> </ScrollView>   </RelativeLayout> 

Problems: i can scroll until the last element of ScrollView

Things i tried:

  1. card view inside the ScrollView (now ScrollView contains RecyclerView) - can see the card up until the RecyclerView
  2. initial thought was to implement this viewGroup using RecyclerView instead of ScrollView where one of it's views type is the CardView but i got the exact same results as with the ScrollView

I'm trying to implement a layout which contains RecyclerView and ScrollView at the same layout.

Layout template:

<RelativeLayout> <ScrollView android:id="@+id/myScrollView">   <unrelated data>...</unrealated data> <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/my_recycler_view" /> </ScrollView>  </RelativeLayout> 

Problems: I can scroll until the last element of ScrollView.

Things I tried:

  1. Card view inside the ScrollView (now ScrollView contains RecyclerView) - can see the card up until the RecyclerView.
  2. Initial thought was to implement this ViewGroup using RecyclerView instead of ScrollView where one of it's views type is the CardView, but I got the exact same results as with the ScrollView.
Question Protected by Hovercraft Full Of Eels
Notice removed Canonical answer required by royB
Bounty Ended with Yang Peiyong's answer chosen by royB
deleted 612 characters in body
Source Link
royB
  • 13k
  • 15
  • 60
  • 85

I'm trying to implement a layout which contains RecyclerView and ScrollView at the same layout.

Layout template:

<RelativeLayout> <ScrollView android:id="@+id/myScrollView"> <unrelated data>...</unrealated data>  </ScrollView> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="id/myScrollView > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView ...   />  <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/my_recycler_view" />   </LinearLayout>ScrollView>  </android.support.v7.widget.CardView>   </RelativeLayout> 

Problems: i can scroll until the last element of ScrollView

Things i tried:

  1. card view inside the ScrollView (now ScrollView contains RecyclerView) - can see the card up until the RecyclerView
  2. initial thought was to implement this viewGroup using RecyclerView instead of ScrollView where one of it's views type is the CardView but i got the exact same results as with the ScrollView

Thanks a lot for your time and help

Roy

I'm trying to implement a layout which contains RecyclerView and ScrollView at the same layout.

Layout template:

<RelativeLayout> <ScrollView android:id="@+id/myScrollView"> <unrelated data>...</unrealated data>  </ScrollView> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="id/myScrollView > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView ...   />  <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/my_recycler_view" />   </LinearLayout>  </android.support.v7.widget.CardView> </RelativeLayout> 

Problems: i can scroll until the last element of ScrollView

Things i tried:

  1. card view inside the ScrollView (now ScrollView contains RecyclerView) - can see the card up until the RecyclerView
  2. initial thought was to implement this viewGroup using RecyclerView instead of ScrollView where one of it's views type is the CardView but i got the exact same results as with the ScrollView

Thanks a lot for your time and help

Roy

I'm trying to implement a layout which contains RecyclerView and ScrollView at the same layout.

Layout template:

<RelativeLayout> <ScrollView android:id="@+id/myScrollView"> <unrelated data>...</unrealated data> <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/my_recycler_view" /> </ScrollView>    </RelativeLayout> 

Problems: i can scroll until the last element of ScrollView

Things i tried:

  1. card view inside the ScrollView (now ScrollView contains RecyclerView) - can see the card up until the RecyclerView
  2. initial thought was to implement this viewGroup using RecyclerView instead of ScrollView where one of it's views type is the CardView but i got the exact same results as with the ScrollView
Notice added Canonical answer required by royB
Bounty Started worth 100 reputation by royB

I'm trying to implement a layout which contains RecyclerView and ScrollView at the same layout.

Layout template:

<RelativeLayout> <ScrollView android:id="@+id/myScrollView"> <unrelated data>...</unrealated data> </ScrollView> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="id/myScrollView > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView ... /> <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/my_recycler_view" /> </LinearLayout> </android.support.v7.widget.CardView> </RelativeLayout> 

Problems: i can scroll until the last element of ScrollViewScrollView

Things i tried:

  1. card view inside the ScrollView ScrollView (now ScrollViewScrollView contains RecyclerViewRecyclerView) - can see the card up until the RecyclerViewRecyclerView
  2. initial thought was to implement this viewGroupviewGroup using RecyclerViewRecyclerView instead of ScrollViewScrollView where one of it's views type is the CardViewCardView but i got the exact same results as with the ScrollViewScrollView

Thanks a lot for your time and help

Roy

I'm trying to implement a layout which contains RecyclerView and ScrollView at the same layout.

Layout template:

<RelativeLayout> <ScrollView android:id="@+id/myScrollView"> <unrelated data>...</unrealated data> </ScrollView> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="id/myScrollView > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView ... /> <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/my_recycler_view" /> </LinearLayout> </android.support.v7.widget.CardView> </RelativeLayout> 

Problems: i can scroll until the last element of ScrollView

Things i tried:

  1. card view inside the ScrollView (now ScrollView contains RecyclerView) - can see the card up until the RecyclerView
  2. initial thought was to implement this viewGroup using RecyclerView instead of ScrollView where one of it's views type is the CardView but i got the exact same results as with the ScrollView

Thanks a lot for your time and help

Roy

I'm trying to implement a layout which contains RecyclerView and ScrollView at the same layout.

Layout template:

<RelativeLayout> <ScrollView android:id="@+id/myScrollView"> <unrelated data>...</unrealated data> </ScrollView> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="id/myScrollView > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView ... /> <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/my_recycler_view" /> </LinearLayout> </android.support.v7.widget.CardView> </RelativeLayout> 

Problems: i can scroll until the last element of ScrollView

Things i tried:

  1. card view inside the ScrollView (now ScrollView contains RecyclerView) - can see the card up until the RecyclerView
  2. initial thought was to implement this viewGroup using RecyclerView instead of ScrollView where one of it's views type is the CardView but i got the exact same results as with the ScrollView

Thanks a lot for your time and help

Roy

Source Link
royB
  • 13k
  • 15
  • 60
  • 85
Loading