8
\$\begingroup\$

I'm new to libgdx and I'm currently working on TableLayout and wondering how could I draw borders for each cells.

I've done some research on this but it seems that I could come up with this solution only: https://stackoverflow.com/questions/13828423/drawing-table-borders-in-libgdx-0-9-7

However, turning on the debug option would be a bit dumb and it's not what I want. I'd like to control the color, thickness of the cell border. Is there anyway to achieve this?

Thanks!

\$\endgroup\$
1
  • \$\begingroup\$ There's also someone suggesting to use a ninepatch as background for the table. You could try to get the tables size and but a ninepatch behind/in front of it with a transparent middlepart and visible outer part \$\endgroup\$
    – VaTTeRGeR
    Apr 11, 2015 at 10:37

1 Answer 1

5
\$\begingroup\$

I don't believe there is a built-in function for this.

You have a few options though:

  1. Use a 9-patch for table background with a border (thats what I do)

  2. Place another table underneath the main table, and make the size a bit bigger so you can see the edges, giving the impression of a border. This is probably your best choice since you want to control color/thickness etc.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Still no better solutions ? \$\endgroup\$
    – Winter
    Jan 4, 2017 at 20:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .