package com.deepblue.shop.Business.CustomView;
import android.widget.GridView;
/**
* Created by Administrator on 2016/7/4 0004.
*/
public class MyGridView extends GridView {
public MyGridView(android.content.Context context,
android.util.AttributeSet attrs) {
super(context, attrs);
}
/**
* 设置不滚动
*/
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
//Integer.MAX_VALUE >> 2 表示右位移两次 就是除以4
/* <<:左移运算符,num << 1, 相当于num乘以2
>>:右移运算符,num >> 1, 相当于num除以2
>>>:无符号右移,忽略符号位,空位都以0补齐*/
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
MeasureSpec.AT_MOST);
/**
* Measure specification mode: The child can be as large as it wants up
* to the specified size.
* public static final int AT_MOST = 2 << MODE_SHIFT;
*/
super.onMeasure(widthMeasureSpec, expandSpec);
}
}
嵌套gridview冲突处理
最新推荐文章于 2017-11-17 14:21:26 发布