I have a two ImageViews.
1.ImageView zoomImageMoveable : should zoom in,out and moveable. 2.ImageView zoomImageFixed : show zoom this is guide line.
I want run different functions from one touch.
{
Fram开发者_StackOverfloweLayout myFrame = new FrameLayout(this.getContext());
myFrame.addView(zoomImageMoveable);
myFrame.addView(zoomImageFixed);
}
Case 1. I tried to attach a listener to each of the view, as they are overlapping only one works.
Case 2. I also tried to wrap the two view with a FrameLayout and added an OnTouchListener to that layout to have it forward the calls to each of the assigned methods. Yet this method also didn't work.
myFrame.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
zoomImageMoveable.onTouchEvent(event);
zoomImageFixed.onTouchEvent(event);
return false;
}
});
How should I approach this issue?
精彩评论