Underline under cursor

让人想犯罪 __ 提交于 2019-12-01 13:25:45

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 my TextInputEditTexts' custom style. In other words, I changed my TextInputEditTexts' style from this:

<style name="MyEditTextStyle" parent="Widget.AppCompat.EditText">
        ...
</style>

to this:

<style name="MyEditTextStyle">
        ...
</style>

Example of one of my TextInputEditTexts referencing the style:

<android.support.design.widget.TextInputEditText
    android:id="@+id/edit_username"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/MyEditTextStyle"/>

Try to set inputType="textNoSuggestions" your edit text in android

     android:inputType="textNoSuggestions"

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

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
    android:width="2dp"
    android:color="#000000" />
</shape>

and your edittext be :

<EditText
    //other attribute/properties
    android:background="@drawable/drawable_name"        
    />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!