TextInputLayout hint color

白昼怎懂夜的黑 提交于 2019-12-03 05:28:41

put android:textColorHint="@color/your_color" inside TextInputLayout

Use android.support.v7.widget.AppCompatEditText instead of EditText and your problems should be resolved. Also make sure your gradle settings are as follows below:

compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:design:22.2.0'
X3Btel

See here

In particular android.support.design:hintTextAppearance="@style/TextAppearance.AppCompat">

Below code worked for me :

<android.support.design.widget.TextInputLayout
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_marginTop="16dp">

         <EditText
              android:id="@+id/email"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:background="@drawable/white_box"
              android:hint="@string/prompt_email"
              android:inputType="textEmailAddress"
              android:maxLines="1"
              android:singleLine="true"
              android:textColor="@color/text_color"
              android:textColorHighlight="@color/text_color"
              android:textColorHint="@color/text_color"
              android:drawableRight="@drawable/ic_action_email"/>
 </android.support.design.widget.TextInputLayout>

textColorHint hint color when edittext is not focused and android:textColorHighlight hint color in floating mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!