为什么我打印的是false 求解答 蟹蟹
package com.example.scrollview;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ScrollView;
import android.widget.TextView;
public class MainActivity extends Activity {
private TextView tv;
private ScrollView scroll;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv=(TextView) findViewById(R.id.textview);
scroll=(ScrollView) findViewById(R.id.scrollview);
tv.getResources().getString(R.id.textview);
scroll.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
switch (event.getAction()){
case MotionEvent.ACTION_MOVE:{
if(scroll.getScrollY()<=0){
Log.i("Main", "顶部");
}
if(scroll.getChildAt(0).getMeasuredHeight()<=scroll.getHeight()+scroll.getScrollY()){
Log.i("Main", "底部");
Log.i("Main", "scroll.getChildAt(0).getMeasuredHeight()="+scroll.getChildAt(0).getMeasuredHeight()+"scroll.getHeight()="+scroll.getHeight()+"scroll.getScrollY()="+scroll.getScrollY());
tv.append(tv.getResources().getString(R.id.textview));
}
break;
}
}
return false;
}
});
}
}