安卓谷歌地图问题

标签 android google-maps-api-3

  1. 我正在尝试为每个 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>
    
  2. 有没有办法在 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/

相关文章:

javascript - Google Maps API 结果变量转换为 php

javascript - Google Maps API 加载问题。需要技术解释。应该很容易回答

Java多接口(interface)继承与值传递

javascript - Google Javascript API Photo getURL 返回临时 URL 并且无法找到 photo_reference

android - 将事件监听器添加到 listView

java - 仅在用户输入时设置 Editview 观察者?

ajax - 仅在点击 <a></a> 时加载 Google map

javascript - 将 mouseevent 传递给 googlemaps 事件监听器

java - 热图未以 fragment 形式显示

java - 当我尝试使用新的地方兼容时出现问题