I've been trying to write this using the general approach of making a class MultiLinearLayout that extends LinearLayout (vertical) and is composed of an ArrayList of horizontal LinearLayout's with the addView method overwritten to stick the view in the last horizontal LinearLayout if it fits, or create a new horizontal LinearLayout if not. Unfortunately on creation time when I'm trying to do all the calculations of if a button would fit or not, nothing is measured so I don't have access to all the various widths. Is it possible to get the widths for a new button and a linearlayout right away without waiting for a layout request? Is this the right approach to this?
thanks, Ravi On Jun 21, 11:26 pm, Romain Guy <[email protected]> wrote: > There's no such layout by default but it's pretty easy to write one. > > > > > > On Sat, Jun 20, 2009 at 4:41 PM, Sebastian<[email protected]> wrote: > > > Is there a way to do a linear layout with multiple lines? > > > I want to lay out a variable set of buttons with variable labels, so > > I'd like to use a layout that works as a simple horizontal > > LinearLayout, but with multiple lines, so the buttons spill into a > > second (or third) line if they don't fit on the first one. > > > Something like this: > > > [Button 1] [abc] [123] [another] > > [more buttons] [xyz] [one more] > > > I looked all over the docs and couldn't find any. Maybe I overlooked > > something, or maybe someone has written an alternative? > > > Thanks, > > Sebastian > > -- > Romain Guy > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time > to provide private support. All such questions should be posted on > public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

