Android google map api V2单击“我的按钮”以显示我的位置,而不是默认按钮
使用Google Map API V1,我可以创建自己的按钮,然后单击按钮显示我的位置 但是谷歌地图API V2,我只能使用默认按钮创建的Android google map api V2单击“我的按钮”以显示我的位置,而不是默认按钮,android,api,button,Android,Api,Button,使用Google Map API V1,我可以创建自己的按钮,然后单击按钮显示我的位置 但是谷歌地图API V2,我只能使用默认按钮创建的 mMap.setMyLationEnabled(true); mMap.setMyLationEnabled(true); 显示糜烂 如何使用自己的按钮显示MyLation,就像单击默认按钮一样 创建人 mMap.setMyLationEnabled(true); mMap.setMyLationEnabled(true); 您可以在mainAc
mMap.setMyLationEnabled(true);
mMap.setMyLationEnabled(true);
显示糜烂
如何使用自己的按钮显示MyLation,就像单击默认按钮一样
创建人
mMap.setMyLationEnabled(true);
mMap.setMyLationEnabled(true);
您可以在mainActivity布局上添加一个按钮。按钮将出现在地图上。主要活动布局如下所示:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="@+id/fragment_map"
android:name="com.ftravelbook.ui.fragments.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:tag="tag_fragment_map" />
<Button
android:id="@+id/btnChangeView"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="View" />
</FrameLayout>