【问题标题】:GridView with variable width items具有可变宽度项目的 GridView
【发布时间】:2014-02-16 00:40:50
【问题描述】:

我需要在 Android 上实现类似 last.fm tag cloud 的行为。

这意味着:我的项目有android:layout_width="wrap_content",我需要水平显示直到项目不能水平显示在View 上,这将是下一行的第一个项目。我还想用ListAdapter 填充视图。

编写这样的视图似乎过于复杂。有没有实现这个效果的库项目?

【问题讨论】:

    标签: android listadapter android-adapterview


    【解决方案1】:

    您要查找的是FlowLayout。它本身并不存在于 Android 中,但 Romain Guy(前 Android 工程师)提供了a talk showing a quick implementation,还有几个库可供您使用,或轻松构建自己的库。

    https://github.com/ApmeM/android-flowlayout
    https://github.com/blazsolar/FlowLayout
    http://nishantvnair.wordpress.com/2010/09/28/flowlayout-in-android/
    http://hzqtc.github.io/2013/12/android-custom-layout-flowlayout.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多