Horizontal ScrollView inside Vertical ScrollView

Horizontal ScrollView inside Vertical ScrollView


As the title suggests, I have some horizontal ScrollViews inside a main vertical ScrollView. Basically a list with each row scrollable horizontally. Now, the issue is that the main (vertical) ScrollView does not work. I’m guessing that’s because the horizontal one catches the event without giving the main one the chance to react. How would I go around this?

Hi, that’s a bit weird layout you have but I would suggest you put a bit of padding on the right of your main(vertical) ScrollView and show the vertical scrollbar. That way, your user will know that it is a vertical scroll view and they would just scroll through that bar if they want to go down.

Thanks for the suggestion! However, this will be a game that also runs on phones and 99% of users will try to scroll like you normally would on a phone. I also don’t use a scrollbar because the contents will, most of the times, not even require scrolling, and if they do, just a little.

Indeed the layout is somewhat weird. It comes from the fact that you can’t have a vertical layout that also increases its width based on children’s size (which would be ideal, then I would simply use a ScrollView that’s both ways). So, my solution was to have a fixed-width vertical Layout where each fixed-width row is a horizontal ScrollView. But I think the best solution is to have each Layout child listen for SIZE_CHANGED and update the Layout’s width dynamically so I can go for the first solution.

Also, Layout grid mode wouldn’t work because I want to separate rows.