好的,这个问题已被多次询问,我已经查看了很多关于它的主题,但我无法让它工作.
我searchView不在动作栏上,所以我不能使用collapseActionView()
我试过了
searchView.clearFocus();//this closes the keyboard but does not remove focus
getActivity().getCurrentFocus().clearFocus(); //basically the same as above
searchView.setQuery("", false); //this clears the query and drops the keyboard
searchView.setIconified(true); // but the search retains focus and keyboard pops up again
Run Code Online (Sandbox Code Playgroud)
无论我尝试什么,我都无法从选择searchView之后移除焦点
我有多个可拖动的对象,可以在屏幕上移动.我想设置一个边界,以便它们不能被拖出屏幕.我真的找不到我想要做的事情.