edittext判断获取焦点 有焦点显示clear
mPhoneEt.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { // TODO Auto-generated method stub if (v.hasFocus()) { mSearchClearUser.setVisibility(View.VISIBLE); }else{ mSearchClearUser.setVisibility(View.INVISIBLE); } } });