1

I have an android application that retrieve some strings from internet, and should create a button for each string, and show it to user. I would show it one after the oter, and when i reach the end of layout (width), other elements should be placed below. for example, if i have this elements:

string1, string2, string3, string4, string5, string6 string7

i would put it inside my layout like:

string1 string2 string3  
string4 string5 string6
string7

(it's it's just a coincidence that in my example each "row" contains exactly three strings)

now i put elements inside Linearlayout with horizontal horientation, but from "string3", all strings goes out from my layout.

How can i do it?

giozh
  • 9,868
  • 30
  • 102
  • 183

1 Answers1

0

there is no such layout that does this automatically, I might recommend a GridView or TableView and a layout file for each different configuration (portrait/landscape, 7/10 inch screens etc) this way you can set the number of columns

tyczj
  • 71,600
  • 54
  • 194
  • 296
  • the problem is that i don't know in advice how many elements will fit inside a single row. It could happen that a line can contains 3 elements, and another one 5 (depends from how long will be strings) – giozh Oct 16 '14 at 07:40