gpt4 book ai didi

android - 如何从 Android 中的 PlaceAutocompleteFragment 中删除搜索图标

转载 作者:太空宇宙 更新时间:2023-11-03 11:47:15 25 4
gpt4 key购买 nike

我正在使用 PlaceAutocompleteFragment 来搜索地点。下面是我的xml代码

<fragment
android:id="@+id/place_source"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/colorPrimary"
android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment" />

我想删除默认带有 fragment 的搜索图标。

screenshot

最佳答案

您可以使用这一行来获取搜索图标的引用:((View)findViewById(R.id.place_autocomplete_search_button)).setVisibility(View.GONE);

此行获取 EditText 的引用:((EditText)findViewById(R.id.place_autocomplete_search_input))

关于android - 如何从 Android 中的 PlaceAutocompleteFragment 中删除搜索图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42211272/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com