I woul like to wrap views (like buttons) inside another view (a button container). I'm not quite sure how to explain it, but an example would be the Stack Overflow tag box (when a question is asked) and the window is narrow. Tags roll over to the next line if they are too long.
Example images using Stack Overflow tag box.
Wide labels auto-flow across multiple lines:
Narrow labels self-distribute on a line:
I get a list of strings from a web service. I don't know how many elements it will have and if the texts will be long or short:
- Example 1: "a", "b", "c". In this case there would be four buttons that would fit seamlessly on one line.
- Example 2: "first text", "second text (long this time)", "short text", "another text", "one more text", "the last text".
The gray view is the container with specific width, and dynamic buttons in blue.
How can I do something like this?


