首页 > 技术文章 > Android百度地图SDK:隐藏(不显示)比例尺,隐藏(不显示)百度LOGO,隐藏(不显示)缩放控件

wisdom-windy 2017-04-15 15:24 原文

MapView mapView= (MapView) findViewById(R.id.home_map_view);

mapView.showScaleControl(false); // 设置比例尺是否可见(true 可见/false不可见)

mapView.showZoomControls(false); // 设置缩放控件是否可见(true 可见/false不可见)

View child=mapView.getChildAt(1); // 找到百度LOGO控件对象

if(child !=null&&(child instanceof ImageView||child instanceof ZoomControls)){
child.setVisibility(View.INVISIBLE); // 设置child这个控件是否可见(VISIBLE 可见/INVISIBLE不可见 /GONE 完全隐藏)
}

推荐阅读