如何在 MapView android 上添加按钮
正如您从问题中看到的,我需要在地图视图上放置一些按钮,应用程序将通过用户按下按钮来刷新地图视图与当前位置。 我知道如何将按钮放在上面、下面,但是如何放在地图上??? 如果有人有一些示例代码,或者一些指导帮助,我们将不胜感激......
As you can see from the question I need to put some button on mapView, where the app will by presing the button by user, refresh the mapView with current location.
I know how to put the button above, under, but how to put on map???
If anyone has some sample code, or some guidance help is appreciated...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您将需要使用RelativeLayout 并将按钮放置在MapView 之上。请确保不要将其放在 Google 徽标上方。下面是一个 XML 示例:
You'll want to use a RelativeLayout and lay the button over top of the MapView. Just make sure not to place it over the Google logo. Here's a sample XML:
你好,伙计,搜索覆盖项目就是你所需要的:D 这里谷歌链接
http://developer.android.com/resources/tutorials/views/hello -mapview.html
和很好的示例:D
https://github.com/jgilfelt/android-mapviewballoons
Hi man search for overlay item is what you need :D here google link
http://developer.android.com/resources/tutorials/views/hello-mapview.html
and good sample :D
https://github.com/jgilfelt/android-mapviewballoons