Search code examples
androidmaterial-designandroid-support-libraryandroid-design-libraryandroid-support-design

TextInputLayout counter to the top


The TextInputLayout introduces a nice counter function in the support-library version 23.1.0 - unfortunately with the floating-hint this gets very high in layout_height. Is there a way to bring the counter to the top ( on the same height as the floating-label? )


Solution

  • Currently you can't do it.

    The TextInputLayout follows the material guide line and the counter is on the bottom.
    Checking the code you can only customize these specs:

    • enable counter also available with xml attribute android.support.design:counterEnabled

    • The counter max lenght also available with xml attribute app:counterMaxLength. (this attr is not currently in the official doc. You can check this post)

    enter image description here