azizbekian..
11
我正在使用新MaterialComponents主题,但没有一个答案对我有帮助.
不得不自己玩风格和主题.将发布一大块样式,以防有人面临同样的问题.
...
@style/CustomFontTextInputLayout
@style/ThemeOverlay.TextInputEditText.OutlinedBox.CustomFont
@style/TextInputEditText.OutlinedBox.CustomFont
@font/my_font
@style/TextInputLayoutHintText
@style/TextInputLayoutHelperText
@style/TextInputLayoutErrorText
@font/my_font
@font/my_font
@font/my_font
然后在xml布局中:
style="@style/TextInputLayout.OutlineBox.CustomFont"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/first_name"/>
这是结果: