美文网首页
ScrollView中嵌套GridView,Listview的办

ScrollView中嵌套GridView,Listview的办

作者: WiiHuu | 来源:发表于2016-01-16 17:47 被阅读226次

    嵌套的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的办

          本文链接:https://www.haomeiwen.com/subject/nenhkttx.html