如何在android中的地方autocompletefragment中更改文本大小?

如何在android中的地方autocompletefragment中更改文本大小?,第1张

概述我正在使用谷歌在我正在进行的项目中提供的PlaceAutocompleteFragment.但问题是我需要显示我从自动完成小部件中选择的地名,但是整个文本没有显示,因为小部件中的默认文本大小太大.那么,有没有什么方法可以在不创建我自己的自定义搜索UI的情况下更改PlaceAutocompleteFragment中的

我正在使用谷歌在我正在进行的项目中提供的PlaceautocompleteFragment.但问题是我需要显示我从自动完成小部件中选择的地名,但是整个文本没有显示,因为小部件中的默认文本大小太大.那么,有没有什么方法可以在不创建我自己的自定义搜索UI的情况下更改PlaceautocompleteFragment中的文本大小?

我的XML代码:

<androID.support.v4.Widget.DrawerLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:app="http://schemas.androID.com/apk/res-auto"    xmlns:tools="http://schemas.androID.com/tools"    androID:ID="@+ID/drawer_layout"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:fitsSystemwindows="true"    tools:context="com.baldysns.capedbaldy.materialdesigntest.activity.DrawerMainActivity"    tools:openDrawer="start">    <linearLayout        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:orIEntation="vertical">        <linearLayout            androID:ID="@+ID/container_toolbar"            androID:layout_wIDth="match_parent"            androID:layout_height="wrap_content"            androID:orIEntation="vertical">            <androID.support.v7.Widget.Toolbar xmlns:androID="http://schemas.androID.com/apk/res/androID"                androID:ID="@+ID/toolbar_drawer"                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:background="?attr/colorPrimary"                androID:minHeight="?attr/actionbarSize"                app:popuptheme="@style/Apptheme.PopupOverlay">                <linearLayout                    androID:ID="@+ID/lnr_Google_searchbar"                    androID:layout_wIDth="match_parent"                    androID:layout_height="35dp"                    androID:layout_margintop="10dp"                    androID:layout_marginBottom="10dp"                    androID:background="@drawable/btn_white_notboerder">                    <fragment                        androID:ID="@+ID/place_autocompletehome_fragment"                        androID:name="com.Google.androID.gms.location.places.ui.PlaceautocompleteFragment"                        androID:layout_wIDth="match_parent"                        androID:layout_height="wrap_content" />                </linearLayout>            </androID.support.v7.Widget.Toolbar>        </linearLayout>        <FrameLayout            androID:ID="@+ID/container_body"            androID:layout_wIDth="match_parent"            androID:layout_height="0dp"            androID:layout_weight="1" />    </linearLayout>    <fragment        androID:ID="@+ID/fragment_navigation_drawer"        androID:name="com.ibaax.com.ibaax.FragmentDrawer"        androID:layout_wIDth="300dp"        androID:layout_height="match_parent"        androID:layout_gravity="start"        app:layout="@layout/fragment_drawer"        tools:layout="@layout/fragment_drawer" /></androID.support.v4.Widget.DrawerLayout>

以及问题的截图:

解决方法:

使用片段实例,您可以使用搜索框EditText@R_318_6502@大小和任何所需的内容..这是您需要执行的 *** 作

// placeautocompleteFragment - is my PlaceautocompleteFragment instance((EditText)placeautocompleteFragment.getVIEw().findVIEwByID(R.ID.place_autocomplete_search_input)).setTextSize(10.0f);
总结

以上是内存溢出为你收集整理的如何在android中的地方autocompletefragment中更改文本大小?全部内容,希望文章能够帮你解决如何在android中的地方autocompletefragment中更改文本大小?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1096741.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-28
下一篇2022-05-28

发表评论

登录后才能评论

评论列表(0条)

    保存