例1:
//imageview在layout控件里
layout.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
imageview.onTouchEvent(event);
return false;
}
});
例2:
//让Gallery上下左右都能滑动
scrollview.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
gallery.onTouchEvent(event);
return false;
}
});