Search code examples
androidlayoutflowlayout

Is there any flowlayout-like layout in android?


I can not find any related layout implementation in android build in layouts.

I found one implementation in this post, Line-breaking widget layout for Android, but in that post's case, there is a precondition that the child's width is not wider than the parent's.

But in my case, the child's width is wider than the parent's. Like say, there is one textview and one image in the layout, the layout's width is 200, while the textview's whole width is 300, and the image's width is 50.

Any build-in implementation in android for this ? Or any suggestion about how to implement this layout by myself ?

Thanks.


Solution

  • I found the solution, which is to use ImageSpan, and then invoked SpannableStringBuilder.setSpan method.