question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to scroll both horizontally and vertically?

See original GitHub issue

This is probably a super dumb question, how do I scroll an image in all directions? Currently I’m putting the image inside a ScrollView but I can only scroll horizontally or vertically, not both.

Am I missing something obvious? Thanks.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

21reactions
Hkmucommented, Sep 27, 2016

Just use two scrollviews. One for horizontal and the other for vertical.

<ScrollView>
    <ScrollView horizontal>
          ....
    </ScrollView>
</ScrollView>
9reactions
jolancornevincommented, May 25, 2017

@TimoRuetten This work for me, with react-native@0.43.1.

You actually have to specify the height and width if your content is not big enough (often the case if you are just testing).

<ScrollView contentContainerStyle={{height: 1000}}>
    <ScrollView horizontal contentContainerStyle={{width: 1000}}>
         ....
    </ScrollView>
</ScrollView>

If this still does not work for you, share a sample of your code, and I’ll take a look at it =)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I make my layout scroll both horizontally and vertically?
I am using a TableLayout. I need to have both horizontal and vertical scrolling for this layout. By default I ...
Read more >
Horizontal Scrolling in Web Design: How to Do It Well
Horizontal scrolling can be achieved by clicking and dragging a horizontal scroll bar, swiping sideways on a desktop trackpad or trackpad mouse, ...
Read more >
Make Android View Scrollable both Horizontally and Vertically
Tutorial to demonstrate how we can make an Android View both Horizontally and Vertically scrollable using HorizontalScrollView and ...
Read more >
how to make layout scrollable both horizontally and vertically
In general, I'd also advise against horizontal scrolling, as that is usually not a good user experience, but if it cannot be avoided...
Read more >
How to add horizontal and vertical scrolling using ScrollView
How to add horizontal and vertical scrolling using ScrollView ; { VStack ; (.horizontal) ; (.horizontal, showsIndicators: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found