给定PopupWindow
这样的定义:
public class MyWindow extends PopupWindow implements View.OnTouchListener {
MyWindow(View view) {
super(view);
setHeight(view.getMeasuredHeight());
setFocusable(true);
setTouchable(true);
setTouchInterceptor(this);
}
public boolean onTouch(View v, MotionEvent event) {
System.out.println("onTouch()");
return true;
}
}
由于某种原因,onTouch()
从未调用过。
我究竟做错了什么?我怎样才能PopupWindow
接受触摸事件?