Give the same Text Input Style that you specify Edittext
<style name="styleTextInputLayout" parent="Widget.Design.TextInputLayout"> <item name="android:textColor">?android:attr/textColorSecondary</item> <item name="android:textColorHint">?android:attr/textColorSecondaryInverse</item> </style> <style name="styleEditText" parent="Widget.AppCompat.EditText"> <item name="android:textColor">?android:attr/textColorSecondary</item> <item name="android:textColorHint">?android:attr/textColorSecondaryInverse</item> </style>
indicate the appropriate colors in the tags above
<android.support.design.widget.TextInputLayout style="@style/styleTextInputLayout" android:layout_width="fill_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/edtTextFirstName" style="@style/styleEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/dimen_5_dp" android:layout_marginTop="@dimen/dimen_5_dp" android:hint="@string/hint_first_name" android:imeOptions="actionNext" android:inputType="textPersonName|textCapWords" android:singleLine="true" /> </android.support.design.widget.TextInputLayout>
above code works with
compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:design:23.0.1'
I ran into a problem with version 22 , maybe there is some error due to which Text Input ignores the entered style.
Solution for com.android.support:design below 23 :
style.xml
<style name="styleTextInputTextAppearance" parent="TextAppearance.AppCompat"> <item name="android:textColorHint">?android:attr/textColorSecondaryInverse</item> </style>
set theme to TextInputLayout
<android.support.design.widget.TextInputLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:theme="@style/styleTextInputTextAppearance"> <EditText android:id="@+id/edtTextTowerName" style="@style/styleEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/dimen_5_dp" android:layout_marginTop="@dimen/dimen_5_dp" android:hint="@string/hint_tower_name" android:imeOptions="actionNext" android:inputType="textCapWords" android:singleLine="true" /> </android.support.design.widget.TextInputLayout>
source share