GridViewNesting.java 1.0 KB
package com.hh.xuetubao.Utils;

import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.widget.GridView;

/**
 * Time: 11/22/2019 9:28
 * Author: 秦小飞
 * Description:
 */
public class GridViewNesting extends GridView {
    public GridViewNesting(Context context) {
        super(context);
    }

    public GridViewNesting(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public GridViewNesting(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public GridViewNesting(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}