вопросы о карте Google Android

1
  1. Я пытаюсь создать базовый макет для каждого вида деятельности. в макете есть панель действий и нижний колонтитул. у меня нет проблем, чтобы показать нижний колонтитул в регулярном действии, но активность MapView не показывает мой нижний колонтитул, хотя я добавляю его в 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. есть ли способ загрузить мои маркеры в MapView после того, как карта закончила загрузку? теперь иногда мои маркеры показываются до загрузки карты.

благодарю!

Теги:
google-maps-api-3

2 ответа

0
Лучший ответ

ok, я нашел ошибку в карте Can
это правильный код:

 <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="0dp"
android:layout_weight="2"   
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>

обратите внимание на android: layout_height и android: layout_weight на карте.

я до сих пор не знаю, как проверить, загружена ли карта, прежде чем показывать маркеры

1
<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>
  • 0
    нет, я обнаружил, что проблема в том, что Android: layout_height = "fill_parent" на карте. Могу ли я сказать ему, чтобы он оставил место для моего нижнего колонтитула?

Ещё вопросы

Сообщество Overcoder
Наверх
Меню