5

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 が太字の場合、自動的に太字のヒントが表示されます。そうでない場合、ヒントは通常です)。

ここに画像の説明を入力

4

1 に答える 1

-2

頭に浮かぶ最も簡単なことは次のとおりです。

strings.xml 内<string name="myHint"><b>Your hint here</b></string>
layout.xml ファイル内<EditText android:hint="@string/myHint"/>

于 2017-09-29T12:45:51.860 に答える