How to remove search icon from PlaceAutocompleteFragment in Android

前端 未结 5 592
一整个雨季
一整个雨季 2021-01-14 03:45

I am using PlaceAutocompleteFragment to search places. Below is my xml code



        
5条回答
  •  情深已故
    2021-01-14 04:23

    It's not possible to customize the look of the PlaceAutocompleteFragment unfortunately but, since all it does is launch the PlaceAutocomplete activity in response to taps it's pretty easy to replicate its functionality with a UI that works for your app.

    1. Create a custom fragment (instructions).
    2. Add the UI elements you want to the fragment.
    3. Add an OnClickListener to the UI elements that starts an autocomplete Activity (as described in the API docs).

提交回复
热议问题