hint
のテキストのスタイルは、私の編集用テキストにinputType=textPassword
と設定したときに変更されます。この画像を参照してください。inputTypeをAndroidのtextPasswordに設定したEditTextのヒントのスタイル
どちらEditTextsが同じXMLを持っていますが、上がtextPassword
からinputType
セットを持っています。
どのように見えるようにするには?
hint
のテキストのスタイルは、私の編集用テキストにinputType=textPassword
と設定したときに変更されます。この画像を参照してください。inputTypeをAndroidのtextPasswordに設定したEditTextのヒントのスタイル
どちらEditTextsが同じXMLを持っていますが、上がtextPassword
からinputType
セットを持っています。
どのように見えるようにするには?
設定EDITTEXT書体デフォルトでは、プログラム
password.setTypeface(Typeface.DEFAULT);
問題は、テキストsetTypefaceです。
ヒント: 「textPassword」入力タイプを使用するのEditText要素を設定するときに は「サンセリフ」にそのフォントファミリを変更する必要がありますので、デフォルトで、フォントファミリは、固定幅フォントに設定されているので、両方のテキストフィールド は、一致するフォントスタイルを使用します。詳細については
のEditText inputTypeでは、このリンク、 Try
を参照してくださいtextPasswordに設定されたフォントはのEditTextパスワードフィールドに 使用TextInputLayoutを変更します
このコード試してみてください。
を<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintEnabled="false"
app:passwordToggleEnabled="true">
<EditText
android:id="@+id/input_password"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
android:drawableLeft="@drawable/ic_password"
android:drawableStart="@drawable/ic_password"
android:hint="@string/password"
android:imeOptions="actionDone"
android:inputType="textPassword"
android:textColor="@color/floating_text_color_accent"
android:textSize="@dimen/text_size_small" />
</android.support.design.widget.TextInputLayout>
[Android:パスワードを適用したときに書体が変更される可能性があります。EditTextで入力](https://stackoverflow.com/questions)/24117178/android-typeface-is-changed-i-apply-password-on-edittext) –