我正在尝试为每个 Activity 构建一个基本布局。布局有一个操作栏和一个页脚。 我在常规 Activity 中显示页脚没有问题,但 MapView Activity 不显示我的页脚,尽管我将它添加到 xml:
<include layout="@layout/actionbar" android:layout_height="wrap_content" android:layout_width="fill_parent"> </include> <com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:enabled="true" android:apiKey="@string/mapAppId" /> <include layout="@layout/footer" android:layout_height="wrap_content" android:layout_width="fill_parent"> </include>
有没有办法在 map 加载完成后在 MapView 中加载我的标记?现在有时我的标记会在 map 加载完成之前显示。
谢谢!
最佳答案
<include layout="@layout/actionbar"
android:id="@+id/headerlayout"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
</include>
<com.google.android.maps.MapView
android:layout_below="@+id/headerlayout"
android:layout_above="@+id/footerlayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:enabled="true"
android:apiKey="@string/mapAppId" />
<include layout="@layout/footer"
android:id="@+id/footerlayout"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
</include>
关于安卓谷歌地图问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10215209/