How to change the floating label color of TextInputLayout

前端 未结 25 1751
[愿得一人]
[愿得一人] 2020-11-22 15:03

With reference to the new TextInputLayout released by Google, how do I change the floating label text color?

Setting colorControlNormal,

相关标签:
25条回答
  • 2020-11-22 15:48

    You don't need to use android:theme="@style/TextInputLayoutTheme" to change the floating label color, since it's going to affect to the entire theme for the small TextView used as label. Instead, you could use app:hintTextAppearance="@style/TextInputLayout.HintText" where:

    <style name="TextInputLayout.HintText">
      <item name="android:textColor">?attr/colorPrimary</item>
      <item name="android:textSize">@dimen/text_tiny_size</item>
      ...
    </style>
    

    Let me know if the solution works :-)

    0 讨论(0)
提交回复
热议问题