Android 如何使edittext默认失去焦点
时间:2017-09-05 18:38:09
收藏:0
阅读:391
1.在布局文件中给edittext的父控件增加两个属性
android:focusable="true"
android:focusableInTouchMode="true"
2.直接调用edittext的clearFocus()方法,不过该方法有时候会不生效
searchView.setFocusable(true);
searchView.setFocusableInTouchMode(true);
searchView.requestFocus();
searchView.clearFocus();//失去焦点
searchView.requestFocus();//获取焦点原文:http://www.cnblogs.com/rocksmall/p/7479674.html
评论(0)