Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么实现类似edittext的maxLength的功能 #14

Open
monakatyking opened this issue Jul 15, 2021 · 0 comments
Open

怎么实现类似edittext的maxLength的功能 #14

monakatyking opened this issue Jul 15, 2021 · 0 comments

Comments

@monakatyking
Copy link

除了再setOnTextChangeListener里面截取字符指定长度的字符串以外还有别的方法么
我尝试再setOnTextChangeListener这个监听里面获取整个字符串的长度,如果超出长度后截取最大长度,然后再通过setHtml将截取的字符串赋值到这个上面,赋值没什么问题,但是光标自动移到首位,导致后面的字符串长度计算出现了混乱
请问还有什么其他的办法可以限制的字数不包含标签,超出的部分无法输入,类似edittext的maxLength的功能么

@monakatyking monakatyking changed the title 怎么实现限制字数 怎么实现类似edittext的maxLength的功能 Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant