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

重写ListView或者GridView的OnMesure 方法:

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


你可能感兴趣的:(Android ScrollView与ListView,GridView共存冲突解决方案)