Andriod RecyclerView实现ListView和Gridview混排

效果图如下

Andriod RecyclerView实现ListView和Gridview混排_第1张图片
Paste_Image.png

主要方法是GridView设置

 gManager = new GridLayoutManager(this,3);  
        gManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {  
            @Override  
            public int getSpanSize(int position) {  
 
                if (position == 0 || position == 7 || position > 13) {  
                    return 3;  
                } else {  
                    return 1;  
                }  
            }  
        });  

参考博文地址:http://blog.csdn.net/chenguang79/article/details/52247912

参考视频地址:http://www.imooc.com/learn/731

你可能感兴趣的:(Andriod RecyclerView实现ListView和Gridview混排)