我正在尝试将TextInputLayout提示文本样式更改为粗体。我使用 TextAppearance 改变了颜色和其他风格的提示:
<style name="MyTextInputLayoutTheme" parent="@android:style/TextAppearance">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">match_parent</item>
<item name="android:textColorHint">@color/black_50</item>
<item name="colorControlNormal">@color/green</item>
<item name="hintAnimationEnabled">false</item>
</style>
我试图设置
<item name="android:textStyle">normal</item>
或
<item name="android:textStyle">bold</item>
但它不起作用。提示文本始终具有编辑文本的样式(如果edittext为粗体,则自动具有粗体提示,如果不是,则提示正常):
答案 0 :(得分:-1)
最容易想到的是:
在strings.xml <string name="myHint"><b>Your hint here</b></string>
内
在layout.xml文件中<EditText android:hint="@string/myHint"/>