Umair Umair - 4 months ago 15x
Android Question

Displaying blog style tags side by side in multiple rows (Android)

Please see the image below:
Multiple Tags appearing side by side

I want to display a set of tags side by side in an Android app.
Conditions are:

  • Each tag appear next to the previous tag.

  • If the horizontal space runs out, the next tag appears in a new line.

  • If there are multiple words in a tag and there's only a space for some of the words of a tag, move the whole tag in a new line. However, if the tag was already in a new line, let the tag break in two lines.

I'm not sure what this technique is called. Any help on the issue, whether by code or link to a library, will be greatly appreciated.


You can use simple libraries for tags, fo instance:


Add to your xml:

    style="@style/TagGroup" />

And add code:

TagGroup mTagGroup = (TagGroup) findViewById(;
mTagGroup.setTags(new String[]{"Tag1", "Tag2", "Tag3"});

Anoter solution is:


Add to xml:


And add to code:

AutoLabelUI mAutoLabel = (AutoLabelUI) view.findViewById(;

AutoLabelUISettings autoLabelUISettings = new AutoLabelUISettings.Builder()


Also, you may use HashtagView