EditText 与TextView 实现 输入同步

随着 EditText的输入更新TextView 的内容  呵呵  挺有意思

关键点就是EditText 实现TextWatcher这个接口 

 

 

        et_input.addTextChangedListener(new TextWatcher(){
			@Override
			public void afterTextChanged(Editable s) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void beforeTextChanged(CharSequence s, int start, int count,
					int after) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void onTextChanged(CharSequence s, int start, int before,
					int count) {
				tv_syn.setText(et_input.getText());
			}});	

 

 

你可能感兴趣的:(textview)