Android - LinearLayout Horizontal with wrapping children

Posted by kape123 on Stack Overflow See other posts from Stack Overflow or by kape123
Published on 2010-06-02T21:36:03Z Indexed on 2010/06/02 22:24 UTC
Read the original article Hit count: 261

Filed under:

Is there a property to set for Android's LinearLayout that will enable it to properly wrap child controls?

Meaning - I have changeable number of children and would like to lay out them horizontally like:

Example: Control1, Control2, Control3, ...

I do that by setting:

ll.setOrientation(LinearLayout.HORIZONTAL);
foreach (Child c in children)
  ll.addView(c);

However, if I have large number of children, last one gets cuts off, instead of going to next line.

Any idea how this can be fixed?

© Stack Overflow or respective owner

Related posts about android