Android ScrollView与ListView,GridView共存冲突解决方案

重写ListView或者GridView的OnMesure 方法:

1 @Override 
2 protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 
3     // TODO Auto-generated method stub 
4     int expandSpec = MeasureSpec.makeMeasureSpec(  
5                Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);  
6      
7     super.onMeasure(widthMeasureSpec, expandSpec); 
8 } 

 


 

posted @ 2014-06-26 14:29  酱包  阅读(126)  评论(0编辑  收藏  举报