不会打印结果,总显示survy data missing
scrollView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE: {
/**
* (1)getScrollY()————滚动条滑动的距离 (2)getMeasuredHeight()
* (3)getHeight()
*/
// 顶部状态
if (scrollView.getScrollY() <= 0) {
Log.i("Main", "滑动到顶部");
}
// 底部状态
// TextView的总高度<=一屏幕的高度+滚动条的滚动距离
if (scrollView.getChildAt(0).getMeasuredHeight() <= scrollView
.getHeight() + scrollView.getScrollY()) {
Log.i("Main", "滑动到底部");
Log.i("Main",
"scroll.getChildAt(0).getMeasuredHeight()="
+ scrollView.getChildAt(0)
.getMeasuredHeight()
+ "scroll,getHeight()="
+ scrollView.getHeight()
+ "scroll.getScrollY()="
+ scrollView.getScrollY());
textView.append(getResources().getString(R.string.text));
}
break;
}
}
return false;
}
});