大小固定为内容大小的recyclerview
public class NoRecyclerView extends RecyclerView{
public NoRecyclerView(Context context) {
super(context);
}
public NoRecyclerView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public NoRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent e) {
return false;
}
@Override
protected void onMeasure(int widthSpec, int heightSpec) {
super.onMeasure(widthSpec, heightSpec);
super.onMeasure(widthSpec, MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST));
}
}