问题
Default hint value of the autocomplete widget is Search
. How can this value be changed to a different String
?
回答1:
Try out the below code:
PlaceAutocompleteFragment places= (PlaceAutocompleteFragment)getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);
EditText etPlace = (EditText)places.getView().findViewById(R.id.place_autocomplete_search_input);
etPlace.setHint("Your Text");
Hope this helps.
来源:https://stackoverflow.com/questions/43505759/how-to-change-the-default-hint-value-of-xml-fragment-element-in-android-layout