package com.tjzhxx.union.custom_view;

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

/**
 * 描述:
 * @author yanghuaxiong
 * @create 2018/4/23 上午10:37
 * 
 */
public class NeverScrollGridView extends GridView {

    public NeverScrollGridView(Context context) {
        super(context);
    }

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

    public NeverScrollGridView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    //不出现滚动条
    @Override
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}