Java Android谷歌地图中的位置按钮
使用map对象调用map.setlocationEnabledtrue 在地图上显示位置按钮 SupportMapFragment SupportMapFragment=SupportMapFragment getSupportFragmentManager.findFragmentByIdR.id.map_fragment; supportMapFragment.getMap.getUiSettings.setZoomControlsEnabledfalse; supportMapFragment.getMap.getUiSettings.setMyLocationButtonEnabledtrue; supportMapFragment.getMap.setMyLocationEnabledtrue 你也可以改变按钮的位置 View locationButton=视图支持MapFragment.getView.FindViewByDinteger.parseInt1.getParent.FindViewByDinteger.parseInt2; RelativeLayout.LayoutParams rlp=RelativeLayout.LayoutParams locationButton.getLayoutParams; //位置在右下角 rlp.addRuleRelativeLayout.ALIGN_PARENT_TOP,0; rlp.addRuleRelativeLayout.ALIGN_PARENT_BOTTOM,RelativeLayout.TRUE; rlp.setMargins0,0,180,80 请阅读Java Android谷歌地图中的位置按钮,java,android,Java,Android,使用map对象调用map.setlocationEnabledtrue 在地图上显示位置按钮 SupportMapFragment SupportMapFragment=SupportMapFragment getSupportFragmentManager.findFragmentByIdR.id.map_fragment; supportMapFragment.getMap.getUiSettings.setZoomControlsEnabledfalse; supportMapFragme