0

Given multiple buttons in a LinearLayout, etc, is it possible to set attributes such that I automagically get them to wrap over multiple lines so as to best utilise the space available, such as one might want to do for implementing a tag cloud.

I could probably use a WebView and appropriate HTML to do what I want to do, but I'd prefer to have a native Android solution.

Ken Y-N
  • 14,644
  • 21
  • 71
  • 114
  • Use `GridLayout` instead of `LinearLayout` to add buttons. – Nishant May 21 '12 at 06:36
  • I found [this earlier question with sample code](http://stackoverflow.com/questions/2961777/android-linearlayout-horizontal-with-wrapping-children) that might help me out... – Ken Y-N May 22 '12 at 01:39

1 Answers1

0

Sounds like you want to use a GridLayout. This will allow you to control the excess space distribution by making the columns stretch equally across the screen.

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
  • That looks like it would do what I want, but it's Ice Cream Sandwich only, isn't it? I'm looking for something that will work on more devices. – Ken Y-N May 21 '12 at 08:59