【发布时间】:2019-10-02 06:57:25
【问题描述】:
我希望缩放控件位于中间的最顶部,我尝试做这样的事情但它不起作用:
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().
findFragmentById(R.id.map);
View mapView = mapFragment.getView();
View zoom_in_button = mapView.findViewWithTag("GoogleMapZoomInButton");
RelativeLayout.LayoutParams location_layout = (RelativeLayout.LayoutParams) zoom_in_button.getLayoutParams();
location_layout.addRule(RelativeLayout.CENTER_HORIZONTAL, 0);
我还需要这样做:将视图居中,使标记位于左下角
我这样做了,但它不起作用。
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(currentPGO.getLatitude(), currentPGO.getLongitude()), 16));
【问题讨论】:
标签: java android google-maps