I am trying to create a full width auto complete text field.
So far, I think I have the text field itself looking right. The problem is with the auto complete popup. It has this very bold shadow all around it and I just can't get rid of it.
Don't get me wrong, I still want the shadow, but a subtle shadow, only on the bottom of the popup, not all around it (especially not at the top, that's really weird).
Something like this:
Here's what mine looks like (sorry for giant image):
activity_main.xml:
<AutoCompleteTextView
android:id="@+id/actvSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginBottom="8dp"
android:background="@drawable/full_width_input"
android:completionThreshold="1"
android:hint="Search a movie..."
android:textColorHint="#BDBDBD"
android:elevation="0dp"
android:popupBackground="@android:color/white" />
full_width_input.xml:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:top="-1dp" android:right="-1dp" android:left="-1dp">
<shape android:shape="rectangle">
<padding android:bottom="20dp" android:top="20dp" android:left="16dp" android:right="16dp" />
<solid android:color="@android:color/white" />
<stroke android:width="1dp" android:color="#E0E0E0" />
</shape>
</item>
</selector>
use android:popupElevation="0"
<AutoCompleteTextView
android:id="@+id/actvSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginBottom="8dp"
android:background="@drawable/full_width_input"
android:completionThreshold="1"
android:hint="Search a movie..."
android:textColorHint="#BDBDBD"
android:popupElevation="0dp"
android:popupBackground="@android:color/white" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With