Gridlayout with borders

user1831490 picture user1831490 · Dec 8, 2012 · Viewed 9.8k times · Source

I'm a new Android developer, and I'm just trying to improve my skill by reading some samples, I want to design a new interface using GridLayout, I've checked a lot of samples but I can't seem to draw borders between the GridLayout cells. What could I be missing?

Here is a link that I went through it, but the borders didn't show up!

http://developer.samsung.com/android/technical-docs/GridLayout-in-Android#

I appreciate your care in advance.

Answer

S.D. picture S.D. · Dec 8, 2012

Android Layout containers don't draw borders. Still:

  1. You can set background of each cell's View to an xml Drawable resource, which describes a transparent rectangle with borders.

  2. Give a background color to GridView's parent View, and set each GridView cell View's background to a different color.

Both of these can also be applied as a Style.