ScrollView中嵌套GridView,Listview的办法以及弹性ScrollView的实现

嵌套的GrdiView和ListView显示不全,直接重写onMessure()方法解决

 public void onMeasure(int widthMeasureSpec,inheightMeasureSpec){     

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

ScrollView 弹性滑动重写overScrollBy()方法

protected boolean overScrollBy(int deltaX, int deltaY, int scrollX,
        int scrollY, int scrollRangeX, int scrollRangeY,
        int maxOverScrollX, int maxOverScrollY, boolean isTouchEvent) {

    return super.overScrollBy(deltaX, deltaY, scrollX, scrollY,
            scrollRangeX, scrollRangeY, maxOverScrollX, 120, isTouchEvent);
}

你可能感兴趣的:(ScrollView中嵌套GridView,Listview的办法以及弹性ScrollView的实现)