Reputation: 5308
Gallery view displays images in a horizontal manner.
Let us consider at landscape mode. The first image is displayed at the centre of the screen. When the user scrolls at the left of the screen, the first image moves to the left of the screen, the second image occupies the centre of the screen. Also, it automatically positions the image at the centre.
Is there any way by which
I can stop displaying the image at the centre.
For example, if I scroll the image to a position, it should stop auto movement & alignment & stop where I have scrolled.
Kindly provide your suggestions. Thanks in advance.
Upvotes: 2
Views: 754
Reputation: 7641
Gallery
will always be a center-locked Layout. You cannot change that.
If you do not have a lot of images to display you can put them in an horizontal LinearLayout
and put the layout inside an HorizontalScrollView
. But beware, you will consume a lot of ressources doing this because all child views will be created.
ListView
and Gallery
layouts have optimisations that allow them to recycle child views while scrolling.
If you need the recycling, you might need to reimplement an horizontal ListView
of your own, without the scroll system of the Gallery
. See this excellent Stackoverflow question on this subject: How can I make a horizontal ListView in Android?
Upvotes: 1