正如你可以从问题中看到的,我需要在mapView上放置一些按钮,其中应用程序将按用户按下按钮,使用当前位置刷新mapView。 我知道如何把上面的按钮,下,但如何把地图? 如果任何人有一些示例代码,或一些指导帮助表示赞赏...如何添加MapView上的按钮android
10
A
回答
29
你要使用的RelativeLayout及以上的MapView的顶部放置按钮。请确保不要将其放在Google徽标上。下面是一个示例XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.maps.MapView android:id="@+id/google_maps"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="@string/maps_key"/>
<Button android:id="@+id/googlemaps_select_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="Select"/>
</RelativeLayout>
2
嗨人搜索覆盖产品,你需要的东西:d这里谷歌链接 http://developer.android.com/resources/tutorials/views/hello-mapview.html
和良好的示例:d
+0
我没有时间看代码,但我会...感谢麻烦;))) – Jovan
相关问题
- 1. 如何在同一个布局中添加mapview和按钮?
- 2. 如何在android中添加按钮?
- 3. 如何为android按钮添加阴影
- 4. 如何在android中添加按钮?
- 5. android:如何添加图片按钮?
- 6. android在softkeyboard上添加按钮
- 7. 如何在我的Android应用上添加共享按钮
- 8. 如何将按钮添加到GoogleMap上
- 9. 如何添加上述recyclerview按钮
- 10. Android:添加覆盖到MapView?
- 11. Android Widget添加按钮
- 12. 如何显示TextView,MapView上的按钮(重叠在上面)..?
- 13. 如何在Android键盘上添加按钮
- 14. 如何在通知FCM上添加按钮Android
- 15. 如何在android主屏幕上添加一个按钮?
- 16. 如何在android手机首页按钮上添加功能?
- 17. android:如何在画布上添加按钮或文本框
- 18. 如何在片段布局上添加按钮?(Google maps Android studio)
- 19. C#如何在按钮阵列按钮上添加图像
- 20. Flex Spark:如何在TabBar按钮上添加取消按钮?
- 21. 如何使添加按钮
- 22. 如何增加按下按钮上的长按超时android
- 23. 通过按下按钮在MapView上创建位置叠加层
- 24. Android MapView绘制POI点击按钮
- 25. 在UINavigationController上添加按钮
- 26. 如何制作MapView按钮(iPhone/iPad)?
- 27. 如何在我的页面上添加按钮(在HTML上放置按钮)
- 28. 的Android:重新按下按钮时动态添加按钮
- 29. 如何把一个透明的按钮放在mapview上?
- 30. Rad Studio如何关闭MapView上的缩放按钮?
感谢的人.. 。这是我正在寻找...再次感谢:DDD – Jovan
谢谢!这对我有帮助! – pandre