How do you change the styling of a fragment? - Google Place Autocomplete

久未见 提交于 2019-12-10 16:34:53

问题


I am an android newbie, so please go easy on me. I have just implement the google places auto complete field, https://developers.google.com/places/android-api/autocomplete .

The only thing I added to the view was this fragment which controls both a textInput, and a modal for the search results which emerges when the textInput gains focus.

<fragment
    android:id="@+id/place_autocomplete_fragment"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"/>

The search input does not match my styling of nearby search fields. I want to adjust it, how do I do this? I have been trying to get the reference to the xml file that the autocomplete search bar is using.

Thank you for any help!


回答1:


You have to redefine their internal styles. For colors that could be:

<color name="place_autocomplete_search_text">@android:color/primary_text_dark</color>
<color name="place_autocomplete_search_hint">@android:color/secondary_text_dark</color>


来源:https://stackoverflow.com/questions/35618457/how-do-you-change-the-styling-of-a-fragment-google-place-autocomplete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!