2012-04-18 6 views
1
  1. Я пытаюсь создать базовый макет для каждого вида деятельности. в макете есть панель действий и нижний колонтитул. я не имею никаких проблем, чтобы показать колонтитул в регулярной деятельности, но MapView активность не показывает мой колонтитула хотя я добавляю его в XML:android google map вопросы

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

спасибо!

ответ

0

хорошо я нашел ошибку в может сопоставить
это правильный код:

<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> 

обратить внимание андроид: layout_height и андроид: 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» на карте. есть способ, которым я могу сказать ему оставить место для моего нижнего колонтитула ?? –