我怎样才能有一个浮动视图以适应具有可变数量的文本视图的多行?

How can I have a floating view to fit in multiple rows with variable number of textviews?

我想在 post 后面显示与我的应用程序中每个 post 相关的标签列表。每行可能有不同数量的标签,具体取决于标签数量以及它们是否适合同一行。就像这个示例图片。另外,我不是前端开发专家!

你要找的是flexbox-layout

FlexboxLayout is a library project which brings the similar capabilities of CSS Flexible Box Layout Module to Android.

请注意 - 在GitHub页面中提到从版本1.1.0开始你将不得不使用AndroidX:

Note that starting from 1.1.0, the library is expected to use with AndroidX. Please migrate to AndroidX if you use 1.1.0 or above.

这也叫FlowLayout

检查这个库:https://github.com/nex3z/FlowLayout