Live character count for EditText

后端 未结 14 2170
清歌不尽
清歌不尽 2020-11-29 17:07

I was wondering what the best way to do a live character count of an edit-text box is in Android. I was looking at this but I couldn\'t seem to make any sense of it.

<
14条回答
  •  孤城傲影
    2020-11-29 17:46

    You can do it with TextInputLayout and compat libraries with:

    app:counterEnabled="true"
    app:counterMaxLength="420"
    

    and complete:

    
    
        
    
    
    

提交回复
热议问题