您如何更改片段的样式?-Google Place自动完成 [英] How do you change the styling of a fragment? - Google Place Autocomplete

查看:61
本文介绍了您如何更改片段的样式?-Google Place自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是android新手,所以请放轻松.我刚刚实现了Google Places自动完成字段, https://developers.google.com/places/android-api/autocomplete .

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 .

我添加到视图中的唯一一件事是该片段,它既控制textInput,又控制当textInput获得焦点时出现的搜索结果的模式.

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"/>

搜索输入与我附近搜索字段的样式不匹配.我要调整它,我该怎么做?我一直在尝试获取自动完成搜索栏正在使用的xml文件的引用.

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.

谢谢您的帮助!

推荐答案

您必须重新定义其内部样式.对于可能是的颜色

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>

这篇关于您如何更改片段的样式?-Google Place自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆