MapView工作不正确 [英] MapView works incorrect

查看:116
本文介绍了MapView工作不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个活动.在主活动中,我使用MapView启动新活动

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

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

在MapView中创建on

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?

推荐答案

在布局中的MapView小部件中添加android:clickable="true".

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

这篇关于MapView工作不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆