2017-11-02 6 views
0

ログインフォームのスタイルを設定しようとしていますが、入力の背景を白にするのに問題があります。Android:すべてのTextAppearanceスタイルを表示する方法

@android:style/TextAppearance.DeviceDefault.Inverseは、入力タイトルの色が白で表示されるため動作します。ただし、ヒントテキストはまだ黒です。

各スタイルを1つずつ試してみるのではなく、すべての種類のテキストの外観スタイルを一度に見せる方法はありますか?私は定義されたスタイルの非常に長いリストがあることに気が付いていますが、それらを一度に比較して見ることはできません。

<android.support.design.widget.TextInputLayout 
       android:id="@+id/textinputlayout" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="15dp" 
       android:layout_marginRight="15dp" 
       android:layout_marginTop="40dp" 
       app:hintTextAppearance="@android:style/TextAppearance.DeviceDefault.Inverse"> 

       <android.support.design.widget.TextInputEditText 
        android:id="@+id/nameEdit" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="User Name" /> 

</android.support.design.widget.TextInputLayout> 

答えて

0

TextInputEditText

でアンドロイドこれを追加してください:textColorHintは= "@カラー/ yourColor"

+0

返信いただきありがとうございますが、スタイルの定義方法を確認できる方法(例:仕様表)はありますか?ヒントテキストの色を変更するだけでなく、定義済みのスタイルがよりよく見えるかどうかを比較したいと思う。 –

0

あなたはこのように行うことができます。

変更TextInputLayoutLEFT-TOPテキストの色

app:hintTextAppearance="@style/text_in_layout_hint_Style" 

スタイルのコード

<style name="text_in_layout_hint_Style"> 
    <item name="android:textColor">#FF0000</item> 
</style> 

あなたは.javaでこれを行うことができます。

textInputLayout.setHintTextAppearance(R.style.text_in_layout_hint_Style); 
+0

返信いただきありがとうございますが、スタイルがどのように定義されているかを確認できる方法(例:仕様表)はありますか?ヒントテキストの色を変更したいだけでなく、定義済みのスタイルがよりよく見えるかどうかを比較することもできます。 –

+0

さらに多くの 'TextInputLayout'を使用し、XMLコードで異なるスタイルを試すことができます。 – KeLiuyue

関連する問題