我只想检测底部的滚动嵌套scrollview android的位置,以及调用函数。我的代码是:
scroll.getViewTreeObserver()
.addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() {
@Override
public void onScrollChanged() {
int totalHeight = scroll.getChildAt(0).getHeight();
int scrollY = scroll.getScrollY();
Log.v("position", "totalHeight=" + totalHeight + "scrollY=" + scrollY);
if (scrollY==totalHeight) {
getPlaylistFromServer("more");
}
}
});
但总高度与 MAX ScrollY 不同。如何解决?