0

I have three RecyclerViews inside a single RecyclerView. I am not able to scroll any of them. Any guidance and suggestion would be highly helpful.

thor
  • 21,418
  • 31
  • 87
  • 173
Ajeet
  • 1,540
  • 1
  • 17
  • 30
  • Post your code here. – Yash Apr 15 '16 at 17:29
  • Nested recyclerView is not something common... as there would be contention of scrolling (the parent or the child recyclerView). Perhaps you could consider using a ScrollView as main wrapper externally? – Elye Apr 15 '16 at 18:06
  • Set exact heights for the inner `RecyclerView`s, and put them in a `NestedScrollView` instead of `RecyclerView`. – Mike M. Apr 15 '16 at 22:13
  • @Elye Yeah I used scrollView as a main wrapper externally as give in this answer http://stackoverflow.com/a/29843093/3074922 . But the scrolling results are not as such as RecyclerView. – Ajeet Apr 16 '16 at 04:44
  • @MikeM. Are there any advantage in NestedScrollView over ScrollView. I haven't tried them. – Ajeet Apr 16 '16 at 04:45
  • @Yashasvi I think you may not require code for my question. – Ajeet Apr 16 '16 at 04:46
  • 1
    The basic scrolling `View`s in Android - like `ScrollView`, `ListView`, etc. - were never meant to be nested, and will give you a major headache trying to get them to scroll properly when they are nested. `NestedScrollView` is specifically made to contain, or be contained in, other scrolling `View`s that implement the appropriate interfaces. `RecyclerView` implements the `NestedScrollingChild` interface, so it will work in a `NestedScrollView`. – Mike M. Apr 16 '16 at 04:54
  • @MikeM. I Tried NestedScrollView. Still it's Scroll Behavior is not such as RecyclerView. I am using this stackoverflow.com/a/29843093/3074922 solution to disable recyclerView scroll – Ajeet Apr 16 '16 at 05:36
  • "Still it's Scroll Behavior is not such as RecyclerView." - I'm not sure what you mean by that, but if you're making the `RecyclerView` non-scrollable, there's really no point in using a `RecyclerView` in the first place. Use a vertically-oriented `LinearLayout` instead. – Mike M. Apr 16 '16 at 05:40
  • I would mention that the built-in `LayoutManager`s now offer the `setAutoMeasureEnabled()` method, which will allow you to set a `wrap_content` height on the `RecyclerView`, if that's what you want to do. I still think it's overkill to use a `RecyclerView` like that, but Google made it possible, so use it if you wanna. – Mike M. Apr 16 '16 at 05:53

0 Answers0