Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
693 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 Reply

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);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...