【发布时间】:2017-11-15 01:03:39
【问题描述】:
我有这个 xml 代码
<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"/>
和java代码
PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)
getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);
autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
@Override
public void onPlaceSelected(Place place) {
// TODO: Get info about the selected place.
Log.i(TAG, "Place: " + place.getName());
}
@Override
public void onError(Status status) {
// TODO: Handle the error.
Log.i(TAG, "An error occurred: " + status);
}
});
我想在开始时以及单击按钮以使其可见时对不可见进行自动完成片段。 我怎样才能做到这一点? 对不起我的英语不好。 谢谢!
【问题讨论】:
-
PlaceAutocompleteFragment 没有方法 setVisibility
-
更改您想要处理片段可见性的问题标题,然后检查这可能会有所帮助stackoverflow.com/questions/14347588/…
-
谢谢!我这样做))))
标签: android