I have implemented Custom edittext, with custom style :
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:textColorHint="@color/white"
app:hintAnimationEnabled="true"
app:hintTextAppearance="@style/TExtAppearance"
>
<com.app.farmtrace.fieldagent.CustomView.EditText_SemiBold
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/colorAccent"
android:theme="@style/EditTextStyle"
android:id="@+id/username"
android:maxLines="1"
android:maxLength="50"
android:inputType="textEmailAddress|textNoSuggestions"
android:nextFocusDown="@+id/password"
/>
</android.support.design.widget.TextInputLayout>
And this is the screen :
there is just the cursor and now when i again select the cursor i get this :
I dont want the yellow underline below the cursor.
This is tested in Moto g4 with android 7.0.
<style name="TExtAppearance">
<item name="android:textColor">@color/white</item>
<item name="android:textColorHighlight">@color/white</item>
<item name="android:textColorHint">@color/white</item>
<item name="android:textColorLink">@color/white</item>
<item name="android:textSize">16sp</item>
</style>
<style name="EditTextStyle" parent="Widget.AppCompat.EditText">
<item name="colorControlNormal">@color/white</item>
<item name="colorControlActivated">@color/colorAccent</item>
<!--<item name="colorControlHighlight">@color/colorAccent</item>-->
</style>
Edit Also Getting underline on error if i seterror and text not visible of error :
try to set background with the help of drawable
make a new drawable file eg. et_back.xml and make a background/shape
then use it as background in your edit text ...
eg. let it be your drawable.xml
and your edittext be :
Try to set inputType="textNoSuggestions" your edit text in android
I ran into the same issue. I was able to get rid of the cursor underline by removing the
Widget.AppCompat.EditText
parent style from myTextInputEditText
s' custom style. In other words, I changed myTextInputEditText
s' style from this:to this:
Example of one of my
TextInputEditText
s referencing the style: