0

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 ....

NikhilReddy
  • 6,904
  • 11
  • 38
  • 58

3 Answers3

0

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

jhansi
  • 548
  • 6
  • 13
0

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.

Community
  • 1
  • 1
Andro Selva
  • 53,910
  • 52
  • 193
  • 240
-1

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.

Jaffa
  • 12,442
  • 4
  • 49
  • 101
Arun
  • 1,658
  • 1
  • 14
  • 21