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);
				}
			}
		});

  

 

posted @ 2015-12-18 14:19  wikiki  阅读(413)  评论(0编辑  收藏  举报