嗨,我是一个新的android开发者。我想创建一个Tab主机应用程序。将有3个不同的选项卡项目,.Each项目附加在地图视图中。我想改变每个地图的缩放标签,当标签的每一个项目。我该怎么做..。
发布于 2011-06-01 15:07:19
在每个选项卡项中,使用MapView以编程方式设置以下行:
mapView.setBuiltInZoomControls(true);
mapView.getController().setZoom(13); //set zoom level according to need for each tab item希望这能解决你的问题。
发布于 2011-06-01 15:36:02
使用此事件
public void onTabChanged(String arg0) {
int currentTabvalue = tabHost.getCurrentTab();if(currentTabvalue==0) mapView.getController().setZoom(-);else if(currentTabvalue==1) mapView.getController().setZoom(-);else if(currentTabvalue==2) mapView.getController().setZoom(-);
}我认为这就是你想要实现的代码。在此代码中,您可以根据需要在-处填充值。我希望你已经得到了答案。
https://stackoverflow.com/questions/6197433
复制相似问题