获取listview当前滚动的高度

public int getScrollY() {
     View c = mListView.getChildAt(0);
     if (c == null ) {
         return 0;
     }
     int firstVisiblePosition = mListView.getFirstVisiblePosition();
     int top = c.getTop();
     return -top + firstVisiblePosition * c.getHeight() ;
}
posted @ 2016-12-13 18:20  wikiki  阅读(398)  评论(0编辑  收藏  举报