19

I cant seem to find an option for nestedScrollView to make it horizontal instead of vertical. i have been using HorizontalScrollView but i'd like to switch to nested. Is there anyway to do this ? searching the docs i dont see it yet it does say its the same as a scrollview ?

j2emanue
  • 60,549
  • 65
  • 286
  • 456

4 Answers4

32

No

I do not believe NestedScrollView can be scrolled horizontally. According to docs:

For vertical scrolling, consider NestedScrollView instead of scroll view which offers greater user interface flexibility and support for the material design scrolling patterns.

As per the text in bold, I believe NestedScrollViews were only made to scroll vertically.

While NestedScrollViews are "just like ScrollView" (link), the docs do also state that:

Scroll view supports vertical scrolling only. For horizontal scrolling, use HorizontalScrollView instead.

(Both blockquotes come from here)

Alexander Costa
  • 549
  • 4
  • 10
0

There is no support to enable the Horizantal nested scrollview in android. Support is only limited to vertical scrollview.

ARUN
  • 71
  • 2
  • 4
0

simply just use "HorizontalScrollView" instead

-3

NestedScrollViews is not a good approach . Better approach is to use recyclerview iniside another recyclerview.

Shahkar Raza
  • 355
  • 3
  • 11
  • 6
    Can you explain that further? – Nico Haase Aug 03 '18 at 07:52
  • I guess he means that RecyclerView is better for large number of child views because they do not create all child views eagerly but lazily unlike all scroll views. For smaller layouts it's not worth the complexity of RVs. – WindRider Feb 25 '21 at 10:18
  • Not necessarily. It really depends on the use case. If you have a relatively small no. of items to display, NestedScrollView is perfectly fine. For large datasets, recyclerview is a better approach. – Harshal Pudale Aug 29 '22 at 12:33