实现瀑布流效果的Android库:StaggeredGridView

jopen 10年前

这是Android的实验StaggeredGridView的修改版本。该StaggeredGridView允许用户创建类似于Pinterest,看起来不平行的GridView。包括自己OnItemClickListener和OnItemLongClickListener,选择器,以及固定位置恢复。
device-2013-11-04-142626-576x1024.jpg

StaggeredGridView可以添加为自定义视图至任何布局中。

属性支持(与GridView相同的行为):

  • numColumns : 确定列将被绘制的量
  • drawSelectorOnTop :确定是否应选择在上面绘制
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"      xmlns:tools="http://schemas.android.com/tools"      xmlns:staggered="http://schemas.android.com/apk/res-auto"      android:layout_width="match_parent"      android:layout_height="match_parent"      android:id="@+id/mainLayout">        <com.origamilabs.library.views.StaggeredGridView          android:id="@+id/staggeredGridView1"          staggered:numColumns="2"          staggered:drawSelectorOnTop="true"          android:layout_width="match_parent"          android:layout_height="wrap_content" />    </LinearLayout>

项目主页:http://www.open-open.com/lib/view/home/1388553875828