5

is possible to have a separator between elements of a GridView?

Thanks

Gerardo
  • 5,800
  • 11
  • 66
  • 94
  • and the question is... how can i display something similar to a table with borders? Table View doesn't shows borders neither... – Gerardo Mar 04 '10 at 22:53

2 Answers2

13

You'll probably have to play with padding and background colors. Set the background for the table to one color, and the background to each View in the table to another color. Set a 1 or 2 pixel padding around each View in the table, and you should have a border between.

Jeff Barger
  • 1,241
  • 1
  • 13
  • 19
  • 2
    In your xml for your GridView, use android:horizontalSpacing="1dp" and android:verticalSpacing="1dp" to set a 1 (density independent) pixel padding around each cell for example. – FreewheelNat Mar 11 '12 at 17:47
1

from @FreewheelNat's comment, "In your xml for your GridView, use android:horizontalSpacing="1dp" and android:verticalSpacing="1dp" to set a 1 (density independent) pixel padding around each cell for example. "

this is a much better solution than @Jeff Barger's

Tyler Davis
  • 2,420
  • 2
  • 23
  • 19