I am struggling some couple of hours with gallery-view,every thing works fine for me,but the thing is i want to remove the spaces in the gallery-view at the front and last..i have gone through some links also but i cannot achieve it ....
3 Answers
Left space or right space any one of it can be removed, by giving left margin to the gallery, and faking the left end to be the center of gallery. Refer to this blog : http://bhaskerkottapally.blogspot.in/2012/03/using-gallery-as-horizontal-list-view.html

- 548
- 6
- 13
It is not easier I believe. You can take a look here.
How to avoid spacing in the start and end of Gallery
I too had the same problem. Either you have to go for a circular gallery to avoid the empty spaces coming around at both ends or might have to follow the answer provided here which might be difficult to implement.

- 1
- 1

- 53,910
- 52
- 193
- 240
Have you implemented gallery view in XMl? if yes then set
android:verticalSpacing="5dp"
android:horizontalSpacing="5dp"
android:columnWidth="70dp"
android:stretchMode="columnWidth"
in your xml. change the values as per your requirement.
If you are doing this by java then you can handle this in your custom adapter class.
-
downvote - GridView attributes have nothing to do with a gallery. – Abhijit Mar 12 '12 at 19:11