2
可能重複的變化:
Is there a way to fire an event when the contents of an EditText view have changed?監控一個EditText上
我想,當用戶以格式化改變編輯文本聽。是否有某種監聽器或接口可以用於此?謝謝
可能重複的變化:
Is there a way to fire an event when the contents of an EditText view have changed?監控一個EditText上
我想,當用戶以格式化改變編輯文本聽。是否有某種監聽器或接口可以用於此?謝謝
你在找什麼可能是TextWatcher
,檢查這link欲瞭解更多信息。以下是如何實現它:
editText.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void afterTextChanged(Editable s) {}
});
你的意思是,EditText的文本更改偵聽器? – Cata