Raheel Sadiq
Raheel Sadiq

Reputation: 9867

android horizontal scrollview

I am using Horizontal Scrollview in android to show images in my app,

i need to make it scroll exact to the initial of the next or previous image on the user's left or right gesture, how it can be solved, it has a linear layout (orientation horizontal) and images are loaded in that,

thanks

Upvotes: 2

Views: 4815

Answers (2)

Tal Kanel
Tal Kanel

Reputation: 10785

there is no property / method / attribute of scroll view which let you do what you want trivially. but the good news is that the solution is simple - don't use scroll view, but views that design for such purpose:

ViewPager

ViewSwitcher

ViewFlipper and example here

Gallery

these three view design for showing and navigating between views with horizontal gestures.
they got attributes / properties / method to control number of view on screen.

Upvotes: 4

Mufazzal
Mufazzal

Reputation: 883

Gallery view is best to solve this

Upvotes: 1

Related Questions