【发布时间】:2014-09-22 17:29:14
【问题描述】:
晚安, 我在滑动选项卡中有一个带有地图的应用程序,但我希望该地图选择一个点并从该点开始。
提前谢谢你。
附上JAVA:
public class Mapa extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View android = inflater.inflate(R.layout.mapa_3, container, false);
return android;
}
@Override
public void onDestroyView() {
super.onDestroyView();
Fragment f = getFragmentManager().findFragmentById(R.id.mapFragment);
if (f != null)
getFragmentManager().beginTransaction().remove(f).commit();
}
}
布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/map_container"
tools:context=".Mapa" >
<fragment
android:id="@+id/mapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
</RelativeLayout>
【问题讨论】:
标签: android eclipse api google-maps-android-api-2