Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is it posible two way scrolling in android

 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to have scroll bars both horizontal and vertical.how to archive this requirement ?I have already HorizontallScrollview in my project.So how to add vertical scroll bar to this ?
 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no built-in view to do this. From a design point of view, it is encouraged to build your application so it only has to scroll one way because it is a better user experience. So I would suggest you attempt to modify your design to present your data in one screen either wide, or one screen tall, so you only need to scroll one way (and use the views that work that way.)

That can't always work, obviously. If you find yourself in need of two way scrolling:
1) You could nest a ScrollView in a HorizontalScrollView, but this leads to poor UX (no diagonal movement, hard to predict which scroll view will do the scrolling, etc...)
2) You could use a custom implementation that takes care of all the above. The one I see referenced most often is this: http://blog.gorges.us/2010/06/android-two-dimensional-scrollview/ but I have never used it.
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic