MapView works incorrect

笑着哭i 提交于 2019-12-25 04:22:20

问题


I have 2 Activities. In main Activity I start new Activity with MapView

Intent set = new Intent();
set.setClass(getApplicationContext(), OrderMap.class);
startActivity(set);

onCreate in MapView

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.map);
    mapView = (MapView) findViewById(R.id.mymapview);
    mapView.setBuiltInZoomControls(true);
    }

But there is no Zoom Controls and it looks like View "freeze". I can't move map. What's wrong?


回答1:


Add android:clickable="true" to your MapView widget in your layout.



来源:https://stackoverflow.com/questions/5758081/mapview-works-incorrect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!