Часть моего макета показана ниже, но кнопка показывает выше MapView и NOT, как ожидалось, "ниже" карты. Как я могу это исправить?
<RelativeLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="@+id/mapview1" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:clickable="true"
android:apiKey="0i4xk7rTGI6b6ggDrC9hOYCbOd9julMg_DG79cg" />
<Button android:id="@+id/btnBanner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text = "text"
android:layout_below="@+id/mapView1"
/>
Значения ID не совпадают:
android:id="@+id/mapview1" // lowercase v
android:layout_below="@+id/mapView1" // uppercase V
Это было бы пойманным во время компиляции, но вы положили знак +
на оба. Это одна из причин, почему я пытаюсь придерживаться правила "поместить знак +
только в первое вхождение".
ИЗМЕНИТЬ
Этот макет работает (хотя вам нужно будет заменить свой ключ API):
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="..."
android:layout_above="@+id/btnBanner"
android:layout_alignParentTop="true"
android:clickable="true" />
<Button android:id="@id/btnBanner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text = "text" />
</RelativeLayout>