我是安卓新手。我正在做一个项目作为我学术的一部分。我想在 Google Map android 的底部有几个按钮,就像在 waze android 应用程序中一样(抱歉,无法发布屏幕截图)。我根据以下链接尝试了一些事情 How to add buttons at top of map fragment API v2 layout .却没有得到想要的结果。
有人可以帮我进行正确的布局吗?感谢您的帮助。
最佳答案
试试这个:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
<Button
android:id="@+id/setRangeButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/setRange" />
</RelativeLayout>
关于dictionary - 在android中向谷歌地图添加按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22847621/