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.
But in my case, the child's width is wider than the parent's.
That is mathematically impossible.
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.
That is mathematically impossible. Your layout's width has to be at least as large as its largest child.
I found the solution, which is to use ImageSpan, and then invoked SpannableStringBuilder.setSpan method.
精彩评论