Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Dialog显示时,如何忽略Dialog背面的View的触摸事件?我使用对话框视图。
试试这个。它可能会帮助你...
<view_in_the_back>.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View arg0, MotionEvent arg1) { if(flag==true){ //code of this touch event... return true; } } });
显示对话框时设置 flag=false。设置为真一个它被解雇了。