你有没有在重写onkeyup或者onkeydown方法 我碰到过一次back失效,是我重写了这两个方法,但是没有处理back键事件,就return true了.dismiss只能在showAsDropDown后面调用 public void dismiss () Since: API Level 1 Dispose of the popup window. This method can be invoked only after showAsDropDown(android.view.View) has been executed. Failing that, calling this method will have no effect.
你看见过主界面上面加一个button(功能是弹出一个对话框),有再加一个button(功能使对话框消失)的??
都只是控制弹出,并不控制消失,消失的控制是在你的是dialog上面,就本例而言是在你的popupWindow上面来实现的,即使你不是现在这个功能,不还有返回键可以控制吗?
按下返回键不也会消失?
但换成showAsDropDown后就彻底挂了,屏幕上所有的控件包括系统的返回键都无效,且失去焦点,死了。。
下面的自然挡住了。
应该可以理解为,它就是一整个屏幕,只是没有盖住的地方时透明的。
不知道我理解的对不对
我碰到过一次back失效,是我重写了这两个方法,但是没有处理back键事件,就return true了.dismiss只能在showAsDropDown后面调用
public void dismiss ()
Since: API Level 1
Dispose of the popup window. This method can be invoked only after showAsDropDown(android.view.View) has been executed. Failing that, calling this method will have no effect.
那我到底该如何实现popview上的imagebutton的onclick?
因为在主view的end按键onclick里调用popview.dismiss();貌似不起作用,调了但是关不掉为保证编译通过,把创建popview实例的代码挪到了主view的onclick中的switch判断之前