Android EditText view Floating Hint in Material Design

前端 未结 10 2179
伪装坚强ぢ
伪装坚强ぢ 2020-12-02 08:13

Does API 21 provide a method to use the following feature:

http://www.google.com/design/spec/components/text-fields.html#text-fields-floating-labels

I\'m try

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 08:52

    @andruboy's suggestion of https://gist.github.com/chrisbanes/11247418 is probably your best bet.

    https://github.com/thebnich/FloatingHintEditText kind of works with appcompat-v7 v21.0.0, but since v21.0.0 does not support accent colors with subclasses of EditText, the underline of the FloatingHintEditText will be the default solid black or white. Also the padding is not optimized for the Material style EditText, so you may need to adjust it.

提交回复
热议问题