自定义View超出屏幕大小,在自定义View里面重写了onTouchEvent方法,请问,如何在case
MotionEvent.ACTION_MOVE:中操作?我看网上说结合scrollTo和scrollBy方法,但也没说具体怎么结合,它们之间是如
何调用了?
下面是我的代码:
activity:
public class AndroidTest03 extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new MyView3(this));
}
}
自定义View:
public class MyView3 extends View {
int cur_x;
int cur_y;
Bitmap pic = null ;
public MyView3(Context ctx) {
super(ctx);
}
public MyView3(Context ctx, AttributeSet attrs) {
super(ctx, attrs);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);