Tim Nuwin Tim Nuwin - 3 months ago 25
Android Question

Remove Shadow in GeocoderAutoCompleteView - Mapbox

How do I remove the border shadow in:
com.mapbox.services.android.geocoder.ui.GeocoderAutoCompleteView

enter image description here

Answer

Could you provide your XML for the geocoder? The geocoding widget extends EditText therefore, you should be able to change the styling similar to an edittext. In the demo app the xml for the widget looks like this:

<com.mapbox.services.android.geocoder.ui.GeocoderAutoCompleteView
    android:id="@+id/query"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"
    android:layout_marginEnd="18dp"
    android:layout_marginStart="18dp"
    android:layout_marginTop="14dp"
    android:background="@android:color/white"
    android:elevation="12dp"
    android:hint="Search Location"
    android:padding="10dp"
    android:singleLine="true"
    android:textColor="@android:color/black"/>

removing the android:elevation="12dp" removes the "shadow".

on a side note, from the screenshot above, the shadow actually looks pretty good ;)

Comments