5

For my app, I'm trying to have a section listing the tags in an article but I wasn't able to find an Android Layout that can achieve this.

Basically, I have an array of strings which contains anywhere from 1 to 5 elements. I want to be able to list them in an manner in which they're sort of staggered. Similar to what a Horizontal LinearLayout would do except it goes to the next line if the next view is too large. I'd have to do this programatically and without a ListView/GridView since it's inside a ScrollView.

Is there any way to achieve this?

Here is an edited image of what I mean... https://i.stack.imgur.com/Hhpry.png

PhotoShop Example

Pkmmte
  • 2,822
  • 1
  • 31
  • 41
  • 5
    You might check [this project](https://github.com/ApmeM/android-flowlayout). I found the link in [this post thread](http://stackoverflow.com/questions/4474237/how-can-i-do-something-like-a-flowlayout-in-android). – Mike M. Jul 23 '14 at 06:58
  • 1
    @MikeM. Thanks, that worked perfectly! I'd mark this as accepted if you were to post it as an answer rather than comment. – Pkmmte Jul 24 '14 at 04:19
  • Nah, thank you, though. I don't deserve any rep just for showing ya where to look. You might post an answer to your question with a few notes as to what you used and how, and mark it as Accepted so this question no longer appears unanswered. Or you might close it/mark it solved. (I'm not sure how that works; I've not asked any questions.) Thanks again. Glad it worked for you. – Mike M. Jul 24 '14 at 04:35
  • Try using the solution on this link [android-multi-line-linear-layout](http://stackoverflow.com/questions/6996837/android-multi-line-linear-layout) – MOHRE Oct 31 '15 at 03:35
  • The project that @MikeM mentioned is amazing. – Iman Akbari Nov 27 '15 at 09:15
  • Possible duplicate of [Android - multi-line linear layout](https://stackoverflow.com/questions/6996837/android-multi-line-linear-layout) – Josh Lee Sep 22 '17 at 12:09
  • The solution for those who don't read comments (like myself): - https://github.com/ApmeM/android-flowlayout - https://stackoverflow.com/questions/6996837/android-multi-line-linear-layout – kzotin Sep 22 '17 at 12:08

0 Answers0