Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
TextInputLayout 在支持库版本 23.1.0 中引入了一个很好的计数器功能 - 不幸的是,使用浮动提示,这在 layout_height 中变得非常高。有没有办法将柜台带到顶部(与浮动标签的高度相同?)
目前你不能这样做。
TextInputLayout遵循材料指南,计数器在底部。 检查代码,您只能自定义这些规范:
TextInputLayout
启用计数器也可用于 xml 属性android.support.design:counterEnabled
android.support.design:counterEnabled
计数器最大长度也可用于 xml 属性app:counterMaxLength。(此属性目前不在官方文档中。您可以查看此帖子)
app:counterMaxLength