【开源】StaggeredGridView瀑布流

介绍:

StaggeredGridView 允许你创建一个不规则的多列GridView ,类似于Pinterest的效果,包含了自己的OnItemClickListener和OnItemLongClickListener。

运行效果:

 

使用说明:

StaggeredGridView 可以作为一个自定义view添加进任何layout中。

支持的属性(和 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>
    

      

posted on 2015-03-23 17:08  wasdchenhao  阅读(544)  评论(0)    收藏  举报

导航