Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove underline from AutoCompleteTextView via xml

i have this view:

<AutoCompleteTextView
        android:id="@+id/search_bar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/rect_search"
        android:layout_alignLeft="@+id/rect_search"
        android:layout_alignRight="@+id/rect_search"
        android:layout_alignTop="@+id/rect_search"
        android:hint="@string/search_bar"
        android:textSize="20sp" />

as you can see, this view goes inside another view, rect_search, that is an ImageView. Now i've noticed that AutoCompleteTextView widget has a default underline on bottom, and i would remove it. It's possible?

like image 869
giozh Avatar asked Apr 29 '14 09:04

giozh


1 Answers

Just put:

android:background="@android:color/transparent"

inside your view.

EDIT: As @kiya said, nowadays is better to use

android:backgroundTint="@android:color/transparent"

As it maintains the view size.

like image 57
Heisenberg Avatar answered Nov 15 '22 17:11

Heisenberg