首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >点击地图标记后显示自定义对话框

点击地图标记后显示自定义对话框
EN

Stack Overflow用户
提问于 2012-09-17 16:06:07
回答 1查看 876关注 0票数 1

在点击地图标记后,我正尝试在地图应用程序中显示一个自定义对话框。这是我的onTap(int index)的代码,根据Android开发人员指南,它不起作用。这是怎么回事?请帮帮我!

代码语言:javascript
运行
复制
@Override
    protected boolean onTap(int index) {
        // TODO Auto-generated method stub
          OverlayItem item = mOverlays.get(index);
          Context mContext = getApplicationContext();
          Dialog dialog = new Dialog(mContext);
          dialog.setContentView(R.layout.marker_view);
          dialog.setTitle(item.getTitle());
          TextView textAddress = (TextView) dialog.findViewById(R.id.tv_marker_address);
          TextView textPhone = (TextView)  dialog.findViewById(R.id.tv_marker_phone);
          textAddress.setText(item.getSnippet());
          ImageView image = (ImageView)  dialog.findViewById(R.id.marker_image); 
          dialog.show();
          Button btn = (Button)dialog.findViewById(R.id.btn1);
          btn1.setOnClickListener(this);
          return true;
    }
}
EN

回答 1

Stack Overflow用户

发布于 2012-09-18 22:23:34

也许你需要先放大布局?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12455290

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档