Recyclerview嵌套Recyclerview常规思路,在外层Recyclerview的条目中写内层Recyclerview
Recyclerview嵌套ListView或者GridView往往只能显示一行,解决方法自定义ListView或者GridView
下面是对GridView的自定义listview也一样:
package com.app.android;
import android.widget.GridView;
/**
* Created by Administrator on 2016/7/28.
* 对内部的GridView进行设置不要让他设置一行
*/
public class MyGridView extends GridView{
public MyGridView(android.content.Context context,
android.util.AttributeSet attrs) {
super(context, attrs);
}
/**
* 设置不滚动
*/
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}
源码下载
http://download.csdn.net/detail/zhaihaohao1/9591211