Closed L-X-J closed 5 years ago
应该可以用mongolEditText.addTextChangedListener(TextWatcher watcher)
,然后监听回车。
参考以下的有关内容:
蒙文是不是从右往左的?
谢谢大佬
addTextChangedListener(object :TextWatcher{
override fun afterTextChanged(s: Editable?) {
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
if (s?.contains("\n") == true) {
//do something
}
}
})
我在用MongolEditText做搜索功框,但是我没办法监听到回车按键,我们的需求是回车就可以搜索, 如果需要改源码,我应该在哪里改