kotlin监听EditView的字数

EditView
special_beizhu.addTextChangedListener(object : TextWatcher {
            override fun afterTextChanged(s: Editable?) {
                publish_text_num.text = "${special_beizhu.text.length}/80"
            }

            override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
            }

            override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
            }

        })

你可能感兴趣的:(Kotlin)