Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
691 views
in Technique[技术] by (71.8m points)

android - How can i remove underline from edittext line though have already background

     <EditText
        android:id="@+id/idLogin"
        android:layout_below="@+id/signintitle"
        android:layout_marginTop="20dp"
        android:fontFamily="@font/calibri_bold"
        android:background="@drawable/editbox"
        android:gravity="center"
        android:textColor="@color/slogan_color"
        android:textSize="20sp"
        android:hint="@string/id"
        android:inputType="text|textNoSuggestions"
        android:textCursorDrawable="@null"
        android:textColorHint="@color/slogan_color"
        android:layout_centerHorizontal="true"
        android:layout_width="350dp"
        android:layout_height="45dp" />

I have a background drawable already, so how can I remove the edittext underline?Check the image for more details.

Any help is appreciated!

enter image description here

question from:https://stackoverflow.com/questions/65950191/how-can-i-remove-underline-from-edittext-line-though-have-already-background

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try this

txtEmail = (EditText) findViewById(R.id.txtEmail); txtEmail.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);

if this not work try this one

android:inputType="textVisiblePassword"

or

.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...