package cn.rongcloud.im.ui.widget; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.GridView; /** * Created by Bob on 15/7/31. */ public class DemoGridView extends GridView { public DemoGridView(Context context) { super(context); } public DemoGridView(Context context, AttributeSet attrs) { super(context, attrs); } public DemoGridView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override public boolean dispatchTouchEvent(MotionEvent ev) { return super.dispatchTouchEvent(ev); } @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, expandSpec); } }